gengliangwang commented on a change in pull request #35113:
URL: https://github.com/apache/spark/pull/35113#discussion_r779506152
##########
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:
BTW ResolvedNamespace and ResolvedDBObjectName are so alike..I didn't
follow the related changes, but can we merge both of them into one? cc
@cloud-fan
--
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]