spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raviteja Lokineni (JIRA)" <>
Subject [jira] [Commented] (SPARK-17893) Window functions should also allow looking back in time
Date Thu, 13 Oct 2016 10:38:20 GMT


Raviteja Lokineni commented on SPARK-17893:

[~srowen] I don't find anything in the documentation which offsets by timestamp or date.
** Offsets by number of rows ahead or behind
** In my case I do not have a fixed number of rows between dates
** I looked at all four definitions of lead/lag in the docs but it offsets only by number
of rows, which in my case is not possible

FYI, the function that I was referring to was: {noformat}def
window(timeColumn: Column, windowDuration: String): Column{noformat}

> Window functions should also allow looking back in time
> -------------------------------------------------------
>                 Key: SPARK-17893
>                 URL:
>             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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message