Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/19492#discussion_r144837080
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JacksonParser.scala
---
@@ -343,6 +368,25 @@ class JacksonParser(
record: T,
createParser: (JsonFactory, T) => JsonParser,
recordLiteral: T => UTF8String): Seq[InternalRow] = {
+ parseWithArrayOfPrimitiveSupport(record, createParser, recordLiteral)
match {
+ case rows: Seq[InternalRow] => rows
+ case _: Seq[_] => throw BadRecordException(() =>
recordLiteral(record), () => None,
+ new RuntimeException("Conversion of array of primitive data is not
yet supported here."))
+ }
+ }
+
+ /**
+ * Parse the JSON input. This function can return a set of
[[InternalRow]]s
+ * if a [[StructType]] is defined as schema, otherwise it returns a set
of
+ * objects.
--- End diff --
Please add comment that this is used when passing `ArrayType` of primitive
types.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]