planga82 commented on a change in pull request #26540: [SPARK-29829][SQL] SHOW
TABLE EXTENDED should do multi-catalog resolution
URL: https://github.com/apache/spark/pull/26540#discussion_r346924692
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveSessionCatalog.scala
##########
@@ -312,6 +312,15 @@ class ResolveSessionCatalog(
case ShowTablesStatement(None, pattern) if
isSessionCatalog(currentCatalog) =>
ShowTablesCommand(None, pattern)
+ case ShowTableStatement(namespace, pattern, partitionsSpec) =>
+ val db = namespace match {
+ case Some(namespace) if (namespace.length != 1) =>
+ throw new AnalysisException(
+ s"The database name is not valid: ${namespace.quoted}")
+ case _ => namespace.map(_.head)
+ }
+ ShowTablesCommand(db, Some(pattern), true, partitionsSpec)
Review comment:
ShowTablesCommand groups two different queries
SHOW TABLES ((FROM | IN) multipartIdentifier)? **(LIKE? pattern=STRING)?**
SHOW TABLE EXTENDED ((FROM | IN) namespace=multipartIdentifier)? **LIKE
pattern=STRING** partitionSpec?
This reuse is the reason why it is optional.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]