pan3793 commented on code in PR #54411:
URL: https://github.com/apache/spark/pull/54411#discussion_r2845862694
##########
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:
cc @cloud-fan, do you think
`AnalysisException`(`REQUIRES_SINGLE_PART_NAMESPACE`) is correct here?
@szehon-ho, anyway, I agree it's beyond the PR scope, we can process it
independently. The PR itself is good to go.
--
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]