spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [spark] planga82 commented on a change in pull request #26540: [SPARK-29829][SQL] SHOW TABLE EXTENDED should do multi-catalog resolution
Date Fri, 15 Nov 2019 17:10:23 GMT
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message