Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/21686#discussion_r199891460
--- Diff: python/pyspark/sql/functions.py ---
@@ -2189,11 +2189,16 @@ def from_json(col, schema, options={}):
>>> df = spark.createDataFrame(data, ("key", "value"))
>>> df.select(from_json(df.value, schema).alias("json")).collect()
[Row(json=[Row(a=1)])]
+ >>> schema = schema_of_json(lit('''{"a": 0}'''))
--- End diff --
feel free to fix other examples above too
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]