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

Prateek Rungta commented on HIVE-11189:
---------------------------------------

Looks like the functions already support it: [1]. So I am able to do what I 
need by passing an extra parameter to the functions. i.e. the 'true' in the 
query below is to specify whether to skill_nulls or not. 

```
SELECT id, LAST_VALUE(col, true) over (PARTITION BY id ORDER BY date)
```

Which means the easy fix is to update the specification for the functions: [2], 
along with the docs. I still think adding syntactic support IGNORE NULLS is a 
good idea, it'll help people already familiar with other systems avoid this 
issue.

[1]: 
https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFLastValue.java#L74
[2]: 
https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFLastValue.java#L40-L41

> Add 'IGNORE NULLS' to FIRST_VALUE/LAST_VALUE
> --------------------------------------------
>
>                 Key: HIVE-11189
>                 URL: https://issues.apache.org/jira/browse/HIVE-11189
>             Project: Hive
>          Issue Type: Improvement
>          Components: PTF-Windowing
>            Reporter: Prateek Rungta
>
> Other RDBMS support the specification of 'IGNORE NULLS' over a paritition to 
> skip NULL values for Analytic Functions. Example - Oracle's docs: 
> http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions057.htm
> Please consider adding this to Hive.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to