pvary commented on code in PR #12692: URL: https://github.com/apache/iceberg/pull/12692#discussion_r2040331964
########## spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/actions/RewriteDataFilesSparkAction.java: ########## @@ -121,32 +113,36 @@ protected RewriteDataFilesSparkAction self() { @Override public RewriteDataFilesSparkAction binPack() { Preconditions.checkArgument( - rewriter == null, "Must use only one rewriter type (bin-pack, sort, zorder)"); - this.rewriter = new SparkBinPackDataRewriter(spark(), table); + runner == null, "Must use only one rewriter type (bin-pack, sort, zorder)"); Review Comment: This is a second request to fix the error message, and it is not too complicated. So changed. The solution is a bit lame: ``` Preconditions.checkArgument( runner == null, "Rewriter type already set to %s", runner == null ? null : runner.description()); ``` We need a second null check for the error message, or a null check around it 😢 Decided to hide this ugliness in a method. If you have better ideas, feel free to comment ########## spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/actions/RewriteDataFilesSparkAction.java: ########## @@ -101,9 +92,10 @@ public class RewriteDataFilesSparkAction private boolean partialProgressEnabled; private boolean removeDanglingDeletes; private boolean useStartingSequenceNumber; - private RewriteJobOrder rewriteJobOrder; - private FileRewriter<FileScanTask, DataFile> rewriter = null; private boolean caseSensitive; + private BinPackRewriteFilePlanner planner = null; + private FileRewriteRunner<FileGroupInfo, FileScanTask, DataFile, RewriteFileGroup> runner = null; + private boolean shufflingPlanner = false; Review Comment: Good idea. Done -- 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