RussellSpitzer commented on a change in pull request #2508:
URL: https://github.com/apache/iceberg/pull/2508#discussion_r635690206
##########
File path:
core/src/main/java/org/apache/iceberg/actions/BaseRewriteDataFilesAction.java
##########
@@ -238,12 +239,13 @@ public RewriteDataFilesActionResult execute() {
}
List<DataFile> addedDataFiles = rewriteDataForTasks(combinedScanTasks);
- List<DataFile> currentDataFiles = combinedScanTasks.stream()
+ Set<DataFile> currentDataFiles = combinedScanTasks.stream()
.flatMap(tasks -> tasks.files().stream().map(FileScanTask::file))
- .collect(Collectors.toList());
- replaceDataFiles(currentDataFiles, addedDataFiles);
+ .collect(Collectors.toSet());
+ List<DataFile> deletedDataFiles =
Lists.newArrayList(currentDataFiles.iterator());
Review comment:
Do we need .iterator? I thought Lists.newArrayList took iterable as an
arg, so set should be fine all by itself, although I'm not sure why we are
doing the "set" operation
--
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]