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 2019/07/27 18:05:00 UTC

[jira] [Resolved] (SPARK-22965) Add deterministic parameter to registerJavaFunction

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

Xiao Li resolved SPARK-22965.
-----------------------------
    Resolution: Won't Fix

> Add deterministic parameter to registerJavaFunction
> ---------------------------------------------------
>
>                 Key: SPARK-22965
>                 URL: https://issues.apache.org/jira/browse/SPARK-22965
>             Project: Spark
>          Issue Type: Bug
>          Components: PySpark
>    Affects Versions: 2.3.0
>            Reporter: Xiao Li
>            Assignee: Xiao Li
>            Priority: Major
>
> To register a JAVA UDF in PySpark, users are unable to specify the registered UDF is not deterministic. The proposal is to add the extra parameter deterministic at the end of the function registerJavaFunction
> Below is an example. 
> {noformat}
> >>> from pyspark.sql.types import DoubleType
> >>> sqlContext.registerJavaFunction("javaRand",
> ...   "test.org.apache.spark.sql.JavaRandUDF", DoubleType(), deterministic=False)
> >>> sqlContext.sql("SELECT javaRand(3)").collect()  # doctest: +SKIP
> [Row(UDF:javaRand(3)=3.12345)]
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

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