rdblue commented on a change in pull request #3269:
URL: https://github.com/apache/iceberg/pull/3269#discussion_r726540402



##########
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 debated that as well. I'm not sure where it would be most clean to put 
this, which is why I added it just to Spark for now. I think we will also want 
to extend this to work for branch or tag names, at which point we may want to 
reconsider moving everything into core.




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

Reply via email to