cloud-fan commented on code in PR #54411:
URL: https://github.com/apache/spark/pull/54411#discussion_r2848007957


##########
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:
   REQUIRES_SINGLE_PART_NAMESPACE looks reasonable, as it's not table not 
exist, but invalid identifier.



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