imback82 commented on a change in pull request #27095: [SPARK-30214][SQL] V2 
commands resolves namespaces with new resolution framework
URL: https://github.com/apache/spark/pull/27095#discussion_r363073621
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
 ##########
 @@ -730,6 +730,8 @@ class Analyzer(
   case class ResolveNamespace(catalogManager: CatalogManager)
     extends Rule[LogicalPlan] with LookupCatalog {
     def apply(plan: LogicalPlan): LogicalPlan = plan resolveOperators {
+      case UnresolvedNamespace(Seq()) =>
+        ResolvedNamespace(currentCatalog.asNamespaceCatalog, Seq.empty[String])
 
 Review comment:
   The conflict here is that `SHOW NAMESPACES` treats `None` as `Nil`, but 
`SHOW TABLES` treats `None` as `current namespace`, thus causing the ambiguity. 
To make `SHOW TABLES` work with `Nil` approach (the current one), I have to do 
the following:
   ```scala
       case ShowTablesStatement(NonSessionCatalogAndNamespace(catalog, ns), 
pattern) =>
         val namespace = if (ns.isEmpty && 
currentCatalog.name.equals(catalog.name)) {
           catalogManager.currentNamespace.toSeq
         } else { ns }
         ShowTables(catalog.asTableCatalog, namespace, pattern)
   ```

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to