rdblue commented on code in PR #5150:
URL: https://github.com/apache/iceberg/pull/5150#discussion_r939702298
##########
core/src/main/java/org/apache/iceberg/BaseTableScan.java:
##########
@@ -94,6 +94,13 @@ public TableScan useSnapshot(long scanSnapshotId) {
tableOps(), table(), tableSchema(),
context().useSnapshotId(scanSnapshotId));
}
+ @Override
+ public TableScan useSnapshotRef(String snapshotRef) {
+ Preconditions.checkArgument(table().snapshot(snapshotRef) != null,
+ "Cannot find ref with name %s", snapshotRef);
+ return useSnapshot(table().snapshot(snapshotRef).snapshotId());
Review Comment:
The logic here needs to be a bit more complicated because you can
time-travel within a branch:
```java
table.newScan().useRef("test-branch").asOfTime(t).planFiles()
```
`useSnapshot` is the most specific and can't be used with anything else.
`useRef` with a tag name is the same way. `useRef` with a branch name is
compatible with `asOfTime`, just like it is with `main` implicitly.
--
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]