pvary commented on code in PR #12651:
URL: https://github.com/apache/iceberg/pull/12651#discussion_r2030691765
##########
core/src/main/java/org/apache/iceberg/actions/BinPackRewriteFilePlanner.java:
##########
@@ -278,10 +278,11 @@ private StructLikeMap<List<FileScanTask>>
groupByPartition(
for (FileScanTask task : tasks) {
// If a task uses an incompatible partition spec the data inside could
contain values
- // which belong to multiple partitions in the current spec. Treating all
such files as
- // un-partitioned and grouping them together helps to minimize new files
made.
+ // which belong to multiple partitions in the current spec.
StructLike taskPartition =
- task.file().specId() == table.spec().specId() ?
task.file().partition() : emptyStruct;
+
table.spec().equalOrFinerThan(table.specs().get(task.file().specId()))
+ ? task.file().partition()
+ : emptyStruct;
Review Comment:
This changes the planning results, so it would be good to add testing to the
core module too, which checks the resulting plan is correct
--
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]