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_r363023439
 
 

 ##########
 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:
   This may not be a good idea since the user may need an extra check to deduce 
whether empty `Seq` is a `None`. For example, I have to do additional check for 
the following command:
   ```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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to