HyukjinKwon commented on code in PR #49875:
URL: https://github.com/apache/spark/pull/49875#discussion_r1951814520
##########
python/pyspark/sql/functions/builtin.py:
##########
@@ -20115,11 +20115,23 @@ def get_json_object(col: "ColumnOrName", path: str)
-> Column:
Examples
--------
+ Example1: Get json object from json object
+
>>> data = [("1", '''{"f1": "value1", "f2": "value2"}'''), ("2", '''{"f1":
"value12"}''')]
>>> df = spark.createDataFrame(data, ("key", "jstring"))
>>> df.select(df.key, get_json_object(df.jstring, '$.f1').alias("c0"), \\
... get_json_object(df.jstring, '$.f2').alias("c1")
).collect()
[Row(key='1', c0='value1', c1='value2'), Row(key='2', c0='value12',
c1=None)]
+
+ Example2: Get json object from json array object
Review Comment:
```suggestion
Example2: Get json object from json array object
```
--
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]