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/08/09 04:40:56 UTC

[GitHub] [iceberg] jackye1995 commented on a diff in pull request #5150: Spark Integration to read from Snapshot ref

jackye1995 commented on code in PR #5150:
URL: https://github.com/apache/iceberg/pull/5150#discussion_r940887940


##########
api/src/main/java/org/apache/iceberg/TableScan.java:
##########
@@ -49,6 +49,16 @@ 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 most recent
+   * snapshot as of the given snapshot ref.
+   *
+   * @param snapshotRef a snapshot Ref
+   * @return a new scan based on this with the given snapshot Ref
+   * @throws IllegalArgumentException if the snapshot cannot be found
+   */
+  TableScan useSnapshotRef(String snapshotRef);

Review Comment:
   > will throw exception for tag type, since we cant do time travel for tag.
   
   In that case I would suggest:
   
   - useRef(String refName)
   - useBranchAsOfTime(String branchName, Long timeStampMillis)



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