Hisoka-X commented on code in PR #40632:
URL: https://github.com/apache/spark/pull/40632#discussion_r1184454024
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JacksonParser.scala:
##########
@@ -134,54 +137,60 @@ class JacksonParser(
// List([str_a_1,null])
// List([str_a_2,null], [null,str_b_3])
//
- case START_ARRAY if allowArrayAsStructs =>
- val array = convertArray(parser, elementConverter, isRoot = true)
- // Here, as we support reading top level JSON arrays and take every
element
- // in such an array as a row, this case is possible.
- if (array.numElements() == 0) {
- Array.empty[InternalRow]
- } else {
- array.toArray[InternalRow](schema)
- }
- case START_ARRAY =>
- throw QueryExecutionErrors.cannotParseJsonArraysAsStructsError()
- }
+ case START_ARRAY if allowArrayAsStructs =>
+ val array = convertArray(parser, elementConverter, isRoot = true)
+ // Here, as we support reading top level JSON arrays and take every
element
+ // in such an array as a row, this case is possible.
+ if (array.numElements() == 0) {
+ Array.empty[InternalRow]
+ } else {
+ array.toArray[InternalRow](schema)
+ }
+ case START_ARRAY =>
+ throw
QueryExecutionErrors.cannotParseJsonArraysAsStructsError(record().toString)
Review Comment:
Changed.
--
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]