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

    https://github.com/apache/spark/pull/16929#discussion_r103268156
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/jsonExpressions.scala
 ---
    @@ -480,36 +480,79 @@ case class JsonTuple(children: Seq[Expression])
     }
     
     /**
    - * Converts an json input string to a [[StructType]] with the specified 
schema.
    + * Converts an json input string to a [[StructType]] or [[ArrayType]] with 
the specified schema.
      */
     case class JsonToStruct(
    -    schema: StructType,
    +    schema: DataType,
         options: Map[String, String],
         child: Expression,
         timeZoneId: Option[String] = None)
       extends UnaryExpression with TimeZoneAwareExpression with 
CodegenFallback with ExpectsInputTypes {
       override def nullable: Boolean = true
     
    -  def this(schema: StructType, options: Map[String, String], child: 
Expression) =
    +  def this(schema: DataType, options: Map[String, String], child: 
Expression) =
         this(schema, options, child, None)
     
    +  override def checkInputDataTypes(): TypeCheckResult = schema match {
    --- End diff --
    
    why not just override:
    
    `override def inputTypes = new TypeCollection(ArrayType, StructType) :: Nil`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to