You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/12/06 00:28:56 UTC

[GitHub] [spark] HyukjinKwon commented on a change in pull request #34809: [SPARK-37550][SQL][DOCS] Add an example of parsing jsonStr with complex types for from_json

HyukjinKwon commented on a change in pull request #34809:
URL: https://github.com/apache/spark/pull/34809#discussion_r762640303



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/jsonExpressions.scala
##########
@@ -522,6 +522,8 @@ case class JsonTuple(children: Seq[Expression])
     Examples:
       > SELECT _FUNC_('{"a":1, "b":0.8}', 'a INT, b DOUBLE');
        {"a":1,"b":0.8}
+      > SELECT from_json('{"teacher": "Alice", "student": [{"name": "Bob", "rank": 1}, {"name": "Charlie", "rank": 2}]}', 'STRUCT<teacher: STRING, student: ARRAY<STRUCT<name: STRING, rank: INT>>>');

Review comment:
       BTW, I would add this example in the end below `timestampFormat` example considering that this example is more complicated then others, and the examples should ideally show from easy ones to harder ones




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