szehon-ho commented on code in PR #7676:
URL: https://github.com/apache/iceberg/pull/7676#discussion_r1202804908


##########
spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/actions/RewriteDataFilesSparkAction.java:
##########
@@ -366,45 +365,29 @@ private Result doExecuteWithPartialProgress(
   }
 
   Stream<RewriteFileGroup> toGroupStream(
-      RewriteExecutionContext ctx,
-      Map<StructLike, List<List<FileScanTask>>> fileGroupsByPartition) {
-    Stream<RewriteFileGroup> rewriteFileGroupStream =
-        fileGroupsByPartition.entrySet().stream()
-            .flatMap(
-                e -> {
-                  StructLike partition = e.getKey();
-                  List<List<FileScanTask>> fileGroups = e.getValue();
-                  return fileGroups.stream()
-                      .map(
-                          tasks -> {
-                            int globalIndex = ctx.currentGlobalIndex();
-                            int partitionIndex = 
ctx.currentPartitionIndex(partition);
-                            FileGroupInfo info =
-                                
ImmutableRewriteDataFiles.FileGroupInfo.builder()
-                                    .globalIndex(globalIndex)
-                                    .partitionIndex(partitionIndex)
-                                    .partition(partition)
-                                    .build();
-                            return new RewriteFileGroup(info, tasks);
-                          });
-                });
-
-    return rewriteFileGroupStream.sorted(rewriteGroupComparator());
+      RewriteExecutionContext ctx, Map<StructLike, List<List<FileScanTask>>> 
groupsByPartition) {

Review Comment:
   (Not related to this pr).  This is my fault, but I think this should be 
'StructLikeMap' all across to be safer, I guess we can do it later.



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