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

    https://github.com/apache/spark/pull/22075#discussion_r209426447
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/higherOrderFunctions.scala
 ---
    @@ -133,51 +142,40 @@ trait HigherOrderFunction extends Expression {
       }
     }
     
    -object HigherOrderFunction {
    -
    -  def arrayArgumentType(dt: DataType): (DataType, Boolean) = {
    -    dt match {
    -      case ArrayType(elementType, containsNull) => (elementType, 
containsNull)
    -      case _ =>
    -        val ArrayType(elementType, containsNull) = 
ArrayType.defaultConcreteType
    -        (elementType, containsNull)
    -    }
    -  }
    -
    -  def mapKeyValueArgumentType(dt: DataType): (DataType, DataType, Boolean) 
= dt match {
    -    case MapType(kType, vType, vContainsNull) => (kType, vType, 
vContainsNull)
    -    case _ =>
    -      val MapType(kType, vType, vContainsNull) = 
MapType.defaultConcreteType
    -      (kType, vType, vContainsNull)
    -  }
    -}
    -
     /**
      * Trait for functions having as input one argument and one function.
      */
     trait SimpleHigherOrderFunction extends HigherOrderFunction with 
ExpectsInputTypes {
     
    -  def input: Expression
    +  def argument: Expression
    +
    +  override def arguments: Seq[Expression] = argument :: Nil
     
    -  override def inputs: Seq[Expression] = input :: Nil
    +  def argumentType: AbstractDataType
    --- End diff --
    
    shall we define a `def argumentTypes: Seq[AbstractDataType]` in 
`HigherOrderFunction` and implement `checkArgumentDataTypes` there?


---

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

Reply via email to