You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/01/06 12:14:50 UTC
[GitHub] [spark] gengliangwang commented on a change in pull request #35113: [SPARK-37636][SQL] Migrate CREATE NAMESPACE to use V2 command by default
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org