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

Herman van Hovell commented on SPARK-17423:
-------------------------------------------

IMO LEAD and LAG with ignore nulls seem a bit dodgy to me.

We support `FIRST` and `LAST` with ignore nulls. You could use this in 
combination with a window frame to create the same functionality. For instance, 
the following query would find the first non null value within the leading 5 
rows:
{noformat}
SELECT *,
       FIRST(value, true) OVER (PARTITION BY grp ORDER BY date ROWS BETWEEN 5 
PRECEDING AND CURRENT ROW)
FROM   tbl
{noformat}

> Support IGNORE NULLS option in Window functions
> -----------------------------------------------
>
>                 Key: SPARK-17423
>                 URL: https://issues.apache.org/jira/browse/SPARK-17423
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 2.0.0
>            Reporter: Tim Chan
>            Priority: Minor
>
> http://stackoverflow.com/questions/24338119/is-it-possible-to-ignore-null-values-when-using-lag-and-lead-functions-in-sq



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