spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Apache Spark (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SPARK-6379) Support an implicit conversion from udf"name" to an UDF defined in SQLContext
Date Tue, 17 Mar 2015 05:08:39 GMT

    [ https://issues.apache.org/jira/browse/SPARK-6379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14364581#comment-14364581
] 

Apache Spark commented on SPARK-6379:
-------------------------------------

User 'maropu' has created a pull request for this issue:
https://github.com/apache/spark/pull/5061

> Support an implicit conversion from udf"name" to an UDF defined in SQLContext
> -----------------------------------------------------------------------------
>
>                 Key: SPARK-6379
>                 URL: https://issues.apache.org/jira/browse/SPARK-6379
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>            Reporter: Takeshi Yamamuro
>
> This is useful for using pre-defined UDFs in SQLContext;
> val df = Seq(("id1", 1), ("id2", 4), ("id3", 5)).toDF("id", "value")
> df.sqlContext.udf.register("simpleUdf", (v: Int) => v * v)
> df.select($"id", udf"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


Mime
View raw message