amogh-jahagirdar commented on code in PR #4926:
URL: https://github.com/apache/iceberg/pull/4926#discussion_r934072711
##########
core/src/main/java/org/apache/iceberg/SnapshotProducer.java:
##########
@@ -116,6 +117,38 @@ public ThisT scanManifestsWith(ExecutorService
executorService) {
return self();
}
+ @Override
+ public ThisT toBranch(String branch) {
+ throw new UnsupportedOperationException("Performing operations on a branch
is currently not supported");
+ }
+
+ /***
+ * Will be used by snapshot producer operations to create a new ref if an
invalid branch is passed
+ * @param branch ref name on which operation is to performed
+ */
+ protected void createNewRef(String branch) {
+ SnapshotRef branchRef =
SnapshotRef.branchBuilder(this.current().currentSnapshot().snapshotId()).build();
+ TableMetadata.Builder updatedBuilder =
TableMetadata.buildFrom(this.current());
+ updatedBuilder.setRef(branch, branchRef);
+ ops.commit(ops.current(), updatedBuilder.build());
Review Comment:
Yeah if we're creating a new branch, the commit for the snapshot producer
needs to encapsulate the producing of the snapshot and the branch creation
--
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]