ajantha-bhat commented on code in PR #8797:
URL: https://github.com/apache/iceberg/pull/8797#discussion_r1354746204


##########
spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/actions/RewriteDataFilesSparkAction.java:
##########
@@ -146,13 +148,31 @@ public RewriteDataFilesSparkAction filter(Expression 
expression) {
     return this;
   }
 
+  @Override
+  public RewriteDataFiles targetBranch(String branch) {
+    this.targetBranch = branch;
+    SnapshotRef ref = table.refs().get(this.targetBranch);

Review Comment:
   what if the user passes the tag name which exists? Should we throw an 
exception by catching this case early?



##########
spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/procedures/RewriteDataFilesProcedure.java:
##########
@@ -109,6 +110,8 @@ public InternalRow[] call(InternalRow args) {
             action = checkAndApplyStrategy(action, strategy, sortOrderString, 
table.schema());
           }
 
+          action = checkAndApplyBranch(table, action);

Review Comment:
   Looks like only the spark WAP branch conf is considered.
   
   Can you please also make it work with branch identifier 
(`branch_yourBranch`) and add testcases too? 
   
https://github.com/apache/iceberg/blob/master/docs/spark-writes.md#writing-to-branches
  



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