Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21439#discussion_r209461334
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JacksonParser.scala
 ---
    @@ -101,6 +102,21 @@ class JacksonParser(
         }
       }
     
    +  private def makeArrayRootConverter(at: ArrayType): JsonParser => 
Seq[InternalRow] = {
    +    val elemConverter = makeConverter(at.elementType)
    +    (parser: JsonParser) => parseJsonToken[Seq[InternalRow]](parser, at) {
    +      case START_ARRAY => Seq(InternalRow(convertArray(parser, 
elemConverter)))
    +      case START_OBJECT if at.elementType.isInstanceOf[StructType] =>
    +        // This handles the case when an input JSON object is a structure 
but
    +        // the specified schema is an array of structures. In that case, 
the input JSON is
    --- End diff --
    
    Could you add an example here, like what we did in `makeStructRootConverter 
`?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to