openinx commented on a change in pull request #1704:
URL: https://github.com/apache/iceberg/pull/1704#discussion_r521782358



##########
File path: 
core/src/main/java/org/apache/iceberg/actions/BaseRewriteDataFilesAction.java
##########
@@ -228,9 +228,18 @@ public RewriteDataFilesActionResult execute() {
         .flatMap(Streams::stream)
         .collect(Collectors.toList());
 
+    // add a filter  to the CombinedScanTask list to avoid repeated rewrite 
datafile
+    List<CombinedScanTask> fileterCombinedScanTasks =
+        combinedScanTasks.stream().filter(task -> task.files().size() > 
1).collect(Collectors.toList());

Review comment:
       I agree with @RussellSpitzer 's comment about "push this into the build 
of Combined scan tasks on line 228", because in that way we don't have to 
construct the `List<CombinedScanTask>` twice,  that is unnecessary. 
   
   BTW,  would you pls add few unit tests to address this case ?  I think it's 
great to improve this but better to fix it with a UT.
   
   Thanks for the work.




----------------------------------------------------------------
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.

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