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

    https://github.com/apache/spark/pull/22732#discussion_r226142651
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/expressions/UserDefinedFunction.scala
 ---
    @@ -73,19 +73,21 @@ case class UserDefinedFunction protected[sql] (
        */
       @scala.annotation.varargs
       def apply(exprs: Column*): Column = {
    -    if (inputTypes.isDefined && nullableTypes.isDefined) {
    -      require(inputTypes.get.length == nullableTypes.get.length)
    +    val numOfArgs = ScalaReflection.getParameterCount(f)
    --- End diff --
    
    since we are here, shall we also check `exprs.length == numOfArgs`?


---

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

Reply via email to