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 generated 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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to