bojana-db commented on code in PR #57373:
URL: https://github.com/apache/spark/pull/57373#discussion_r3623358773
##########
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:
Good point that they look redundant at first glance. I actually meant them
to name the two modes: with create_if_missing = false it's a strict set
(replace an existing value only, no-op if the path is missing) and with
create_if_missing = true (default) it's an upsert (replace if present, create
if missing), but happy to reword if you still find it confusing.
--
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]