RussellSpitzer commented on code in PR #9803: URL: https://github.com/apache/iceberg/pull/9803#discussion_r1504779675
########## spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/actions/SparkBinPackDataRewriter.java: ########## @@ -58,13 +58,14 @@ protected void doRewrite(String groupId, List<FileScanTask> group) { .option(SparkWriteOptions.REWRITTEN_FILE_SCAN_TASK_SET_ID, groupId) .option(SparkWriteOptions.TARGET_FILE_SIZE_BYTES, writeMaxFileSize()) .option(SparkWriteOptions.DISTRIBUTION_MODE, distributionMode(group).modeName()) + .option(SparkWriteOptions.OUTPUT_SPEC_ID, outputSpecId()) .mode("append") .save(groupId); } // invoke a shuffle if the original spec does not match the output spec private DistributionMode distributionMode(List<FileScanTask> group) { - boolean requiresRepartition = !group.get(0).spec().equals(table().spec()); + boolean requiresRepartition = !group.get(0).spec().equals(table().specs().get(outputSpecId())); Review Comment: noted above we may want to have a protected method outputSpec() to wrap table().specs().get(outputSpecId()) -- 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