HyukjinKwon commented on code in PR #39519: URL: https://github.com/apache/spark/pull/39519#discussion_r1067581392
########## sql/core/src/test/scala/org/apache/spark/sql/JsonFunctionsSuite.scala: ########## @@ -583,6 +583,17 @@ class JsonFunctionsSuite extends QueryTest with SharedSparkSession { checkAnswer(df, Seq(Row("STRUCT<a: BIGINT>"))) } + test("schema_of_json works on non-foldable columns") { Review Comment: ```suggestion test("SPARK-41995: schema_of_json works on non-foldable columns") { ``` ########## sql/core/src/test/scala/org/apache/spark/sql/JsonFunctionsSuite.scala: ########## @@ -583,6 +583,17 @@ class JsonFunctionsSuite extends QueryTest with SharedSparkSession { checkAnswer(df, Seq(Row("STRUCT<a: BIGINT>"))) } + test("schema_of_json works on non-foldable columns") { + val in = Seq("""{"a": [1, 2, 3]}""").toDS() + val out = in.select(schema_of_json($"value") as "parsed_schema") + checkAnswer(out, Row("STRUCT<a: ARRAY<BIGINT>>")) + } + + test("schema_of_json returns null on null input") { Review Comment: ```suggestion test("SPARK-41995: schema_of_json returns null on null input") { ``` -- 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-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org