gengliangwang commented on a change in pull request #35113:
URL: https://github.com/apache/spark/pull/35113#discussion_r779505662



##########
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:
       The logic of this function is very similar to 
`DatabaseInSessionCatalog`. Shall we throw a similar exception if the nameParts 
is empty?




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