spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Li Jin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SPARK-22239) User-defined window functions with pandas udf
Date Wed, 21 Mar 2018 21:56:00 GMT

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

Li Jin commented on SPARK-22239:
--------------------------------

I am looking into this. I will start with unbounded window first, i.e., Window.partitionBy(df.id).
Growing/Shrinking/Moving windows are much more complicated because we don't want to send theĀ each
window to python worker. I will try to solve the simple case (unbounded window) first.

> User-defined window functions with pandas udf
> ---------------------------------------------
>
>                 Key: SPARK-22239
>                 URL: https://issues.apache.org/jira/browse/SPARK-22239
>             Project: Spark
>          Issue Type: Sub-task
>          Components: PySpark
>    Affects Versions: 2.2.0
>         Environment: 
>            Reporter: Li Jin
>            Priority: Major
>
> Window function is another place we can benefit from vectored udf and add another useful
function to the pandas_udf suite.
> Example usage (preliminary):
> {code:java}
> w = Window.partitionBy('id').orderBy('time').rangeBetween(-200, 0)
> @pandas_udf(DoubleType())
> def ema(v1):
>     return v1.ewm(alpha=0.5).mean().iloc[-1]
> df.withColumn('v1_ema', ema(df.v1).over(window))
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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


Mime
View raw message