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 2021/12/10 18:00:37 UTC

[GitHub] [spark] imback82 commented on a change in pull request #34861: [SPARK-37606][SQL] ALTER NAMESPACE ... SET PROPERTIES v2 command should use existing properties in addition to new properties

imback82 commented on a change in pull request #34861:
URL: https://github.com/apache/spark/pull/34861#discussion_r766877252



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/AlterNamespaceSetPropertiesExec.scala
##########
@@ -29,7 +31,8 @@ case class AlterNamespaceSetPropertiesExec(
     namespace: Seq[String],
     props: Map[String, String]) extends LeafV2CommandExec {
   override protected def run(): Seq[InternalRow] = {
-    val changes = props.map{ case (k, v) =>
+    val existingProps = catalog.loadNamespaceMetadata(namespace.toArray).asScala.toMap
+    val changes = (existingProps ++ props).map { case (k, v) =>
       NamespaceChange.setProperty(k, v)

Review comment:
       OK, makes sense. I will close this PR.




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