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

Sean Owen commented on SPARK-17893:
-----------------------------------

Maybe:
- Aggregate by day
- Generate a DataFrame containing all days from the start to end of your data
- Outer join with that, to fill in a row for missing dates
- Use 7-row lagging window to aggregate over sliding 7-day intervals

> 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-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to