pan3793 commented on code in PR #54026:
URL: https://github.com/apache/spark/pull/54026#discussion_r2736129178
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/CreateNamespaceExec.scala:
##########
@@ -37,22 +38,14 @@ case class CreateNamespaceExec(
private var properties: Map[String, String])
extends LeafV2CommandExec {
override protected def run(): Seq[InternalRow] = {
- import org.apache.spark.sql.connector.catalog.CatalogV2Implicits._
- import org.apache.spark.sql.connector.catalog.SupportsNamespaces._
-
val ns = namespace.toArray
- if (!catalog.namespaceExists(ns)) {
- try {
- val ownership =
- Map(PROP_OWNER -> Utils.getCurrentUserName())
- catalog.createNamespace(ns, (properties ++ ownership).asJava)
- } catch {
- case _: NamespaceAlreadyExistsException if ifNotExists =>
- logWarning(log"Namespace ${MDC(NAMESPACE, namespace.quoted)} was
created concurrently. " +
- log"Ignoring.")
- }
- } else if (!ifNotExists) {
- throw QueryCompilationErrors.namespaceAlreadyExistsError(ns)
+ try {
+ val ownership = Map(PROP_OWNER -> Utils.getCurrentUserName())
+ catalog.createNamespace(ns, (properties ++ ownership).asJava)
+ } catch {
+ case _: NamespaceAlreadyExistsException if ifNotExists =>
Review Comment:
happens here
https://github.com/apache/spark/blob/589fedc9b231f49a8cf808ac901fbdb3f44de271/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala#L345-L355
--
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]