tdcmeehan commented on code in PR #59138:
URL: https://github.com/apache/spark/pull/59138#discussion_r4289717665
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/json/JsonSuite.scala:
##########
@@ -1479,6 +1479,31 @@ abstract class JsonSuite
}
}
+ gridTest("multiline top level JSON array ends the document at a syntax error
in a nested object")(
+ Seq("PERMISSIVE", "DROPMALFORMED")) { mode =>
+ withSQLConf(
+ SQLConf.JSON_STREAM_MULTILINE_TOP_LEVEL_ARRAY.key -> "true",
+ SQLConf.JSON_ENABLE_PARTIAL_RESULTS.key -> "true") {
+ withTempPath { file =>
+ // Resuming inside the second element would return `t`'s object as a
row.
+ val document = """[{"a":1},{"s":{"x":1 2},"t":{"a":9}},{"a":2}]"""
Review Comment:
Thanks, added your document as a second case of this grid (`array of
structs`, schema `a INT, arr ARRAY<STRUCT<x: INT>>, _corrupt_record STRING`) in
28d2f38b871.
- With the guard narrowed to `context.inArray`, both new cases fail in
`JsonV1Suite`, `JsonV2Suite`, `JsonLegacyTimeParserSuite` and
`JsonUnsafeRowSuite`: the read also returns `[5,null,null]`, in PERMISSIVE and
DROPMALFORMED. The struct cases still pass.
- With the full guard, all 16 cases pass.
--
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]