From b9ee4182e5580c06eeaa30cafc98355efe224f07 Mon Sep 17 00:00:00 2001 From: vaultah <4944562+vaultah@users.noreply.github.com> Date: Thu, 8 Feb 2024 08:00:17 +0000 Subject: [PATCH] Fix condition --- .../apache/iceberg/spark/actions/BaseCopyTableSparkAction.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/actions/BaseCopyTableSparkAction.java b/spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/actions/BaseCopyTableSparkAction.java index 7217a02a9b13..e1f0e129502c 100644 --- a/spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/actions/BaseCopyTableSparkAction.java +++ b/spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/actions/BaseCopyTableSparkAction.java @@ -693,7 +693,8 @@ record = recordIt.next(); writer.write(newPositionDeleteRecord(record, sourcePrefix, targetPrefix)); } - for (; recordIt.hasNext(); record = recordIt.next()) { + while (recordIt.hasNext()) { + record = recordIt.next(); writer.write(newPositionDeleteRecord(record, sourcePrefix, targetPrefix)); } } finally {