dohongdayi commented on a change in pull request #34127:
URL: https://github.com/apache/spark/pull/34127#discussion_r722263212



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveCatalogs.scala
##########
@@ -80,8 +80,8 @@ class ResolveCatalogs(val catalogManager: CatalogManager)
         writeOptions = c.writeOptions,
         orCreate = c.orCreate)
 
-    case UseStatement(isNamespaceSet, nameParts) =>
-      if (isNamespaceSet) {
+    case Use(UnresolvedDBObjectName(nameParts, isNamespace)) =>

Review comment:
       One way to resolve `UnresolvedDBObjectName` in single place, is
   
   `case UnresolvedDBObjectName(CatalogAndNamespace(catalog, name), _) =>
         ResolvedDBObjectName(catalog, name)
   ......
     case Use(ResolvedDBObjectName(catalog, ns)) =>
         val namespace = if (ns.nonEmpty) Some(ns) else None
         SetCatalogAndNamespace(catalogManager, Some(catalog.name()), namespace)
   `
   
   But it will change the behavior of `USE NAMESPACE ...` to keep it in line 
with `CREATE NAMESPACE ...`, which is NO different with `USE ...`




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to