You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Xiao Li (JIRA)" <ji...@apache.org> on 2017/07/09 03:54:05 UTC

[jira] [Created] (SPARK-21350) Fix the error message when the number of arguments is wrong when invoking a UDF

Xiao Li created SPARK-21350:
-------------------------------

             Summary: 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.1.1, 2.0.2, 2.2.0
            Reporter: Xiao Li
            Assignee: Xiao Li


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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org