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

[jira] [Updated] (SPARK-6379) Support a functon to call user-defined functions registered in SQLContext

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

Michael Armbrust updated SPARK-6379:
------------------------------------
    Assignee: Takeshi Yamamuro

> Support a functon to call user-defined functions registered in SQLContext
> -------------------------------------------------------------------------
>
>                 Key: SPARK-6379
>                 URL: https://issues.apache.org/jira/browse/SPARK-6379
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>            Reporter: Takeshi Yamamuro
>            Assignee: Takeshi Yamamuro
>             Fix For: 1.4.0
>
>
> This is useful for using pre-defined UDFs in SQLContext;
> val df = Seq(("id1", 1), ("id2", 4), ("id3", 5)).toDF("id", "value")
> val sqlctx = df.sqlContext
> sqlctx.udf.register("simpleUdf", (v: Int) => v * v)
> df.select($"id", sqlctx.callUdf("simpleUdf", $"value"))



--
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