You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "harshmotw-db (via GitHub)" <gi...@apache.org> on 2026/07/21 02:01:02 UTC

Re: [PR] [SPARK-58221] Add `try_variant_set` expression [spark]

harshmotw-db commented on code in PR #57373:
URL: https://github.com/apache/spark/pull/57373#discussion_r3618905927


##########
sql/api/src/main/scala/org/apache/spark/sql/functions.scala:
##########
@@ -9988,6 +9988,92 @@ object functions {
   def variant_set(v: Column, path: String, value: Column, createIfMissing: Boolean): Column =
     Column.fn("variant_set", v, lit(path), value, lit(createIfMissing))
 
+  /**
+   * Sets or upserts a value in a variant at the given JSONPath location. An existing object field

Review Comment:
   Same here



##########
python/pyspark/sql/functions/builtin.py:
##########
@@ -21911,6 +21911,71 @@ def variant_set(
     )
 
 
+@_try_remote_functions
+def try_variant_set(
+    v: "ColumnOrName",
+    path: Union[Column, str],
+    value: "ColumnOrName",
+    create_if_missing: bool = True,
+) -> Column:
+    """
+    Sets or upserts a value in a variant at the given JSONPath location. An existing object field

Review Comment:
   Should just be "Upsert" or "Sets and inserts" IMO. Upserts is already a combination of insert and update



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