You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (JIRA)" <ji...@apache.org> on 2017/07/09 03:58:02 UTC
[jira] [Commented] (SPARK-21350) Fix the error message when the
number of arguments is wrong when invoking a UDF
[ https://issues.apache.org/jira/browse/SPARK-21350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16079433#comment-16079433 ]
Apache Spark commented on SPARK-21350:
--------------------------------------
User 'gatorsmile' has created a pull request for this issue:
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
>
> 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