pan3793 commented on code in PR #54411:
URL: https://github.com/apache/spark/pull/54411#discussion_r2843894588


##########
sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2DataFrameSessionCatalogSuite.scala:
##########
@@ -111,7 +113,25 @@ class InMemoryTableSessionCatalog extends 
TestV2SessionCatalogBase[InMemoryTable
     val identToUse = 
Option(InMemoryTableSessionCatalog.customIdentifierResolution)
       .map(_(ident))
       .getOrElse(ident)
-    super.loadTable(identToUse)
+
+    // For single-part namespaces, follow Iceberg's pattern: first try to load 
the table
+    // normally, fall back to metadata table resolution only on 
NoSuchTableException
+    try {
+      super.loadTable(identToUse)
+    } catch {
+      case _: AnalysisException if identToUse.name().toLowerCase(Locale.ROOT) 
== "snapshots" =>

Review Comment:
   the api say it should throw NoSuchTableException, but actually 
AnalysisException?
   
   
https://github.com/apache/spark/blob/5059bab37f7142f8688ee35ee1211bf23dae8e06/sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/TableCatalog.java#L140-L150



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