amogh-jahagirdar commented on code in PR #5364:
URL: https://github.com/apache/iceberg/pull/5364#discussion_r930582859


##########
core/src/main/java/org/apache/iceberg/DataTableScan.java:
##########
@@ -61,6 +61,24 @@ public TableScan appendsAfter(long fromSnapshotId) {
     return appendsBetween(fromSnapshotId, currentSnapshot.snapshotId());
   }
 
+  @Override
+  public TableScan useBranch(String name) {
+    Preconditions.checkArgument(snapshotId() == null,
+            "Cannot override snapshot, already set to id=%s", snapshotId());
+    SnapshotRef ref = tableOps().current().ref(name);
+    Preconditions.checkArgument(ref != null, "Branch %s does not exist", name);
+    Preconditions.checkArgument(ref.isBranch(), "Ref %s is a tag, not a 
branch", name);
+    long branchTip = tableOps().current().ref(name).snapshotId();
+    return useSnapshot(branchTip);
+  }
+
+  @Override
+  public TableScan useBranch(String name, long timestampMillis) {
+    Preconditions.checkArgument(snapshotId() == null,

Review Comment:
   This check isn't needed, already done in useSnapshot



##########
core/src/main/java/org/apache/iceberg/DataTableScan.java:
##########
@@ -61,6 +61,24 @@ public TableScan appendsAfter(long fromSnapshotId) {
     return appendsBetween(fromSnapshotId, currentSnapshot.snapshotId());
   }
 
+  @Override
+  public TableScan useBranch(String name) {
+    Preconditions.checkArgument(snapshotId() == null,
+            "Cannot override snapshot, already set to id=%s", snapshotId());

Review Comment:
   Same as below



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