mxm commented on code in PR #18661:
URL: https://github.com/apache/iceberg/pull/18661#discussion_r4402835425


##########
flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/maintenance/api/RewriteDataFilesConfig.java:
##########
@@ -30,6 +30,13 @@
 public class RewriteDataFilesConfig {
   public static final String PREFIX = FlinkMaintenanceConfig.PREFIX + 
"rewrite.";
 
+  public static final String BRANCH = PREFIX + "branch";
+  public static final ConfigOption<String> BRANCH_OPTION =
+      ConfigOptions.key(BRANCH)
+          .stringType()
+          .noDefaultValue()
+          .withDescription("The branch to compact. Defaults to the sink's 
write branch.");

Review Comment:
   Say the sink writes to a staging branch and convert-equality-deletes targets 
another branch. Then this default compacts the staging branch, which is not 
what we want. Could we default to the convert target branch in that case, or 
reject the combination in `IcebergSink` builder? Could also be a follow-up.



##########
flink/v2.3/flink/src/test/java/org/apache/iceberg/flink/maintenance/api/TestRewriteDataFiles.java:
##########
@@ -619,34 +621,59 @@ void testRewriteWithFilterSupplier() throws Exception {
 
   @Test
   void testBranch() throws Exception {
+    Table table = createTableWithBranch(TEST_BRANCH);
+
+    rewriteAndAssertBranchCompacted(
+        table, 
RewriteDataFiles.builder().rewriteAll(true).branch(TEST_BRANCH));
+  }
+
+  @Test
+  void testRewriteOnCustomBranch() throws Exception {

Review Comment:
   Should we add a test to `TestIcebergSinkTableMaintenance` as well?



##########
flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/maintenance/api/RewriteDataFilesConfig.java:
##########
@@ -170,6 +177,11 @@ public long maxRewriteBytes() {
         .parse();
   }
 
+  /** Gets the branch to compact. */

Review Comment:
   NIT: Should this be:
   ```suggestion
     /** Gets the branch to compact, or null to compact the sink's write 
branch. */
   ```



-- 
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]

Reply via email to