cloud-fan commented on a change in pull request #34861:
URL: https://github.com/apache/spark/pull/34861#discussion_r766495402
##########
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:
Sorry I was wrong. The v2 API takes a list of `NamespaceChange`, which
is kind of the "diff", not the entire namespace properties. That said, the
previous behavior is correct: Spark just passes the "new properties need to be
set/update" to the v2 catalog implementations.
This is a better API design than v1, as passing "diff" is cheaper than
getting the existing properties and passing the full properties.
--
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]