Fokko commented on code in PR #5748:
URL: https://github.com/apache/iceberg/pull/5748#discussion_r973224538


##########
spark/v3.0/spark/src/main/java/org/apache/iceberg/spark/source/SparkWrite.java:
##########
@@ -422,13 +421,8 @@ private RewriteFiles(String fileSetID) {
     @Override
     public void commit(WriterCommitMessage[] messages) {
       FileRewriteCoordinator coordinator = FileRewriteCoordinator.get();
-
-      Set<DataFile> newDataFiles = 
Sets.newHashSetWithExpectedSize(messages.length);
-      for (DataFile file : files(messages)) {
-        newDataFiles.add(file);
-      }
-
-      coordinator.stageRewrite(table, fileSetID, 
Collections.unmodifiableSet(newDataFiles));
+      Set<DataFile> newDataFiles = ImmutableSet.copyOf(files(messages));

Review Comment:
   Maybe good to add a test. Examples are here: 
https://github.com/apache/iceberg/pull/5437/files#diff-260d07a95eec0ca51526bc88fce0a8a86b0df2ec54fe3d705b0bfe9db9ae2db1R104-R124



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to