Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22775#discussion_r228389510
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/jsonExpressions.scala
 ---
    @@ -752,14 +752,20 @@ case class StructsToJson(
     case class SchemaOfJson(
         child: Expression,
         options: Map[String, String])
    -  extends UnaryExpression with String2StringExpression with 
CodegenFallback {
    +  extends UnaryExpression with ExpectsInputTypes with CodegenFallback {
     
       def this(child: Expression) = this(child, Map.empty[String, String])
     
       def this(child: Expression, options: Expression) = this(
           child = child,
           options = ExprUtils.convertToMapData(options))
     
    +  override def dataType: DataType = StringType
    +
    +  override def inputTypes: Seq[DataType] = Seq(StringType)
    --- End diff --
    
    why do we need it since we already override `checkInputDataTypes`?


---

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

Reply via email to