You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Reynold Xin (JIRA)" <ji...@apache.org> on 2015/07/04 07:15:04 UTC

[jira] [Resolved] (SPARK-8572) Type coercion for ScalaUDFs

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

Reynold Xin resolved SPARK-8572.
--------------------------------
       Resolution: Fixed
         Assignee: Cheolsoo Park
    Fix Version/s: 1.5.0

> Type coercion for ScalaUDFs
> ---------------------------
>
>                 Key: SPARK-8572
>                 URL: https://issues.apache.org/jira/browse/SPARK-8572
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>            Reporter: Yin Huai
>            Assignee: Cheolsoo Park
>            Priority: Critical
>             Fix For: 1.5.0
>
>
> Seems we do not do type coercion for ScalaUDFs. The following code will hit a runtime exception.
> {code}
> import org.apache.spark.sql.functions._
> val myUDF = udf((x: Int) => x + 1)
> val df = sqlContext.range(1, 10).toDF("i").select(myUDF($"i"))
> df.explain(true)
> df.show
> {code}
> It is also good to check if we do type coercion for PythonUDFs.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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