nastra commented on a change in pull request #3269:
URL: https://github.com/apache/iceberg/pull/3269#discussion_r752046746
##########
File path: spark3/src/main/java/org/apache/iceberg/spark/SparkCatalog.java
##########
@@ -456,10 +466,97 @@ private static void checkNotPathIdentifier(Identifier
identifier, String method)
}
}
- private Table load(Identifier ident) {
- return isPathIdentifier(ident) ?
- tables.load(((PathIdentifier) ident).location()) :
- icebergCatalog.loadTable(buildIdentifier(ident));
+ private Pair<Table, Long> load(Identifier ident) {
+ if (isPathIdentifier(ident)) {
+ return loadFromPathIdentifier((PathIdentifier) ident);
+ }
+
+ try {
+ return Pair.of(icebergCatalog.loadTable(buildIdentifier(ident)), null);
+
+ } catch (org.apache.iceberg.exceptions.NoSuchTableException e) {
+ // if the original load didn't work, the identifier may be extended and
include a snapshot selector
+ TableIdentifier namespaceAsIdent =
buildIdentifier(namespaceToIdentifier(ident.namespace()));
Review comment:
I think we may want to support the timestamp as part of the
`TableIdentifier`. I think this would align better with what we're planning to
do anyway for Snapshot Branching/Tagging, where the `TableIdentifier` needs to
understand what reference we're currently at. Similarly, it would also
understand the timestamp.
I'll update
https://docs.google.com/document/d/1KSgkVYnIMlWEbAT1qSnnnLS-gc0kdgHlWR6Ud08HOhA/edit#heading=h.zf5ulr1b1ytv
to also respect timestamps
--
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]