stevenzwu commented on code in PR #5740:
URL: https://github.com/apache/iceberg/pull/5740#discussion_r967968651
##########
spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/SparkCatalog.java:
##########
@@ -579,23 +565,68 @@ private static void checkNotPathIdentifier(Identifier
identifier, String method)
}
}
- private Pair<Table, Long> load(Identifier ident) {
+ private Table load(Identifier ident, String version) {
+ Table table = load(ident);
+
+ if (table instanceof SparkTable) {
+ SparkTable sparkTable = (SparkTable) table;
+
+ Preconditions.checkArgument(
+ sparkTable.snapshotId() == null,
+ "Cannot do time-travel based on both table identifier and AS OF");
+
+ return sparkTable.copyWithSnapshotId(Long.parseLong(version));
+
+ } else if (table instanceof SparkChangelogTable) {
+ throw new UnsupportedOperationException("AS OF is not supported for
changelogs");
Review Comment:
nit: maybe complete `AS OF` as `AsOfTime`
--
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]