You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "szehon-ho (via GitHub)" <gi...@apache.org> on 2023/05/23 18:11:44 UTC
[GitHub] [iceberg] szehon-ho commented on a diff in pull request #7676: Spark 3.3: Harmonize RewriteDataFilesSparkAction
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: 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