You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Sean Owen (JIRA)" <ji...@apache.org> on 2016/10/13 09:26:20 UTC

[jira] [Resolved] (SPARK-17893) Window functions should also allow looking back in time

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

Sean Owen resolved SPARK-17893.
-------------------------------
    Resolution: Not A Problem

This might be better as a question on the mailing list, not a JIRA. THis is already possible; have a look at the API docs: http://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.sql.expressions.Window

Look at rowsBetween, and look into LEAD/LAG for SQL syntax.

> Window functions should also allow looking back in time
> -------------------------------------------------------
>
>                 Key: SPARK-17893
>                 URL: https://issues.apache.org/jira/browse/SPARK-17893
>             Project: Spark
>          Issue Type: New Feature
>          Components: Spark Core
>    Affects Versions: 2.0.1
>            Reporter: Raviteja Lokineni
>
> This function should allow looking back. The current window(timestamp, duration) seems to be for looking forward in time.
> Example:
> {code}dataFrame.groupBy(window("date", "7 days ago")).agg(min("col1"), max("col1")){code}
> For example, if date: 2013-01-07 then the window should be 2013-01-01 - 2013-01-07



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