amogh-jahagirdar commented on code in PR #5010:
URL: https://github.com/apache/iceberg/pull/5010#discussion_r936187028
##########
core/src/main/java/org/apache/iceberg/FastAppend.java:
##########
@@ -114,6 +114,21 @@ public FastAppend appendManifest(ManifestFile manifest) {
return this;
}
+ @Override
+ public FastAppend toBranch(String branch) {
+ Preconditions.checkArgument(branch != null, "branch cannot be null");
+ if (ops.current().ref(branch) == null) {
+ super.createNewRef(branch);
+ }
+
+ Preconditions.checkArgument(ops.current()
+ .ref(branch).type()
+ .equals(SnapshotRefType.BRANCH),
+ "%s is not a ref to type branch", branch);
Review Comment:
Also now that we're creating a branch if it doesn't exist, on commit, we
should do a null check. It's okay if the branch is null, since we'll create it.
if it's not null, it must be a ref of type branch.
##########
core/src/main/java/org/apache/iceberg/FastAppend.java:
##########
@@ -114,6 +114,21 @@ public FastAppend appendManifest(ManifestFile manifest) {
return this;
}
+ @Override
+ public FastAppend toBranch(String branch) {
+ Preconditions.checkArgument(branch != null, "branch cannot be null");
+ if (ops.current().ref(branch) == null) {
+ super.createNewRef(branch);
+ }
+
+ Preconditions.checkArgument(ops.current()
+ .ref(branch).type()
+ .equals(SnapshotRefType.BRANCH),
+ "%s is not a ref to type branch", branch);
Review Comment:
Also now that we're creating a branch if it doesn't exist, on commit, we
should do a null check. It's okay if the branch is null, since we'll create it.
if it's not null, it must be an actual 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]