You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/09/16 17:04:47 UTC

[GitHub] [iceberg] Fokko commented on a diff in pull request #5748: Spark: Simplify RewriteFiles.commit

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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org