You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/07/27 15:19:51 UTC

[GitHub] [iceberg] hililiwei commented on a diff in pull request #5364: Core, API: Support scanning from a branch along with time travel

hililiwei commented on code in PR #5364:
URL: https://github.com/apache/iceberg/pull/5364#discussion_r931196128


##########
api/src/main/java/org/apache/iceberg/TableScan.java:
##########
@@ -53,6 +53,30 @@ public interface TableScan extends Scan<TableScan, FileScanTask, CombinedScanTas
    */
   TableScan asOfTime(long timestampMillis);
 
+  /**
+   * Create a new {@link TableScan} from this scan's configuration that will use the tip snapshot of the given branch
+   *
+   * @param branch a snapshot ID
+   * @return a new scan based on this with the given snapshot ID
+   * @throws IllegalArgumentException if the branch cannot be found
+   */
+  default TableScan useBranch(String branch) {
+    throw new UnsupportedOperationException("Scanning from a branch is not supported");
+  }
+
+  /**
+   * Create a new {@link TableScan} from this scan's configuration that will use the most recent snapshot
+   * as of the given time in milliseconds.
+   *
+   * @param branch branch name
+   * @param timestampMillis  a timestamp in milliseconds.
+   * @return a new scan based on this with the given branch and timestamp
+   * @throws IllegalArgumentException if the branch or snapshot cannot be found
+   */
+  default TableScan useBranch(String branch, long timestampMillis) {

Review Comment:
   +1 for useBranchAsOfTime



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org