aokolnychyi commented on code in PR #5301:
URL: https://github.com/apache/iceberg/pull/5301#discussion_r929356959


##########
core/src/main/java/org/apache/iceberg/ManifestGroup.java:
##########
@@ -156,6 +156,14 @@ ManifestGroup planWith(ExecutorService newExecutorService) 
{
    * @return a {@link CloseableIterable} of {@link FileScanTask}
    */
   public CloseableIterable<FileScanTask> planFiles() {
+    return plan((entries, ctx) -> CloseableIterable.transform(entries, entry 
-> {
+      DataFile dataFile = entry.file().copy(ctx.shouldKeepStats());
+      DeleteFile[] deleteFiles = ctx.deletes().forEntry(entry);
+      return new BaseFileScanTask(dataFile, deleteFiles, ctx.schemaAsString(), 
ctx.specAsString(), ctx.residuals());
+    }));

Review Comment:
   @flyrain, can you elaborate a bit? I am not sure I understood.
   Do you mean creating an explicit `CreateFileScanTaskFunction` and using it 
here?
   
   I did not use `BiFunction` to avoid a bulky definition.
   
   ```
   public <T extends ScanTask> CloseableIterable<T> 
plan(BiFunction<CloseableIterable<ManifestEntry<DataFile>>, TaskContext, 
CloseableIterable<T>> createTasksFunc) {
   
   ...
   }
   ```
   



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