[ 
https://issues.apache.org/jira/browse/SPARK-21350?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Wenchen Fan resolved SPARK-21350.
---------------------------------
       Resolution: Fixed
    Fix Version/s: 2.3.0

Issue resolved by pull request 18574
[https://github.com/apache/spark/pull/18574]

> Fix the error message when the number of arguments is wrong when invoking a 
> UDF
> -------------------------------------------------------------------------------
>
>                 Key: SPARK-21350
>                 URL: https://issues.apache.org/jira/browse/SPARK-21350
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.0.2, 2.1.1, 2.2.0
>            Reporter: Xiao Li
>            Assignee: Xiao Li
>             Fix For: 2.3.0
>
>
> Got a confusing error message when the number of arguments is wrong when 
> invoking a UDF. 
> {noformat}
>     val df = spark.emptyDataFrame
>     spark.udf.register("foo", (_: String).length)
>     df.selectExpr("foo(2, 3, 4)")
> {noformat}
> {noformat}
> org.apache.spark.sql.UDFSuite$$anonfun$9$$anonfun$apply$mcV$sp$12 cannot be 
> cast to scala.Function3
> java.lang.ClassCastException: 
> org.apache.spark.sql.UDFSuite$$anonfun$9$$anonfun$apply$mcV$sp$12 cannot be 
> cast to scala.Function3
>       at 
> org.apache.spark.sql.catalyst.expressions.ScalaUDF.<init>(ScalaUDF.scala:109)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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

Reply via email to