cloud-fan commented on a change in pull request #35113:
URL: https://github.com/apache/spark/pull/35113#discussion_r779542240



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveSessionCatalog.scala
##########
@@ -609,4 +604,14 @@ class ResolveSessionCatalog(val catalogManager: 
CatalogManager)
           resolved.namespace.map(quoteIfNeeded).mkString("."))
     }
   }
+
+  private object DatabaseNameInSessionCatalog {
+    def unapply(resolved: ResolvedDBObjectName): Option[String] = resolved 
match {
+      case ResolvedDBObjectName(catalog, _) if !isSessionCatalog(catalog) => 
None
+      case ResolvedDBObjectName(_, Seq(dbName)) => Some(dbName)
+      case _ =>
+        assert(resolved.nameParts.length > 1)

Review comment:
       `ResolvedDBObjectName` does not require the db object to exist, while 
`ResolvedNamespace` requires the namespace to exist.




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