nk1506 commented on code in PR #8797:
URL: https://github.com/apache/iceberg/pull/8797#discussion_r1354331345
##########
spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/actions/RewriteDataFilesSparkAction.java:
##########
Review Comment:
I think we need to add this for other spark versions as well.
##########
spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/procedures/RewriteDataFilesProcedure.java:
##########
Review Comment:
I think we need to add this for other spark versions as well.
##########
spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/actions/RewriteDataFilesSparkAction.java:
##########
@@ -146,13 +148,29 @@ public RewriteDataFilesSparkAction filter(Expression
expression) {
return this;
}
+ @Override
+ public RewriteDataFiles targetBranch(String branch) {
+ this.targetBranch = branch;
+ return this;
+ }
+
+ protected long startingSnapshotId() {
+ if (SnapshotRef.MAIN_BRANCH.equals(this.targetBranch)) {
+ return table.currentSnapshot().snapshotId();
+ } else {
+ SnapshotRef ref = table.refs().get(this.targetBranch);
+ assert (ref != null);
Review Comment:
I think we should replace with `Preconditions` .
##########
spark/v3.5/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestRewriteDataFilesProcedure.java:
##########
Review Comment:
Can we have a test case with `fastForward` to `main` 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]