rdblue commented on a change in pull request #26006: [SPARK-29279][SQL] Merge 
SHOW NAMESPACES and SHOW DATABASES code path
URL: https://github.com/apache/spark/pull/26006#discussion_r331658063
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveCatalogs.scala
 ##########
 @@ -185,8 +183,7 @@ class ResolveCatalogs(val catalogManager: CatalogManager)
         SetCatalogAndNamespace(catalogManager, None, Some(nameParts))
       } else {
         val CurrentCatalogAndNamespace(catalog, namespace) = nameParts
-        val ns = if (namespace.isEmpty) { None } else { Some(namespace) }
-        SetCatalogAndNamespace(catalogManager, Some(catalog.name()), ns)
+        SetCatalogAndNamespace(catalogManager, Some(catalog.name()), namespace)
 
 Review comment:
   This will always set the catalog, even if it is already the current? Why not 
use a rule that doesn't fill in the catalog and returns None instead?

----------------------------------------------------------------
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