[
https://issues.apache.org/jira/browse/HIVE-24908?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Krisztian Kasa resolved HIVE-24908.
-----------------------------------
Resolution: Fixed
Pushed to master. Thanks [~jcamachorodriguez] for review.
> Adding Respect/Ignore nulls as a UDAF parameter is ambiguous
> ------------------------------------------------------------
>
> Key: HIVE-24908
> URL: https://issues.apache.org/jira/browse/HIVE-24908
> Project: Hive
> Issue Type: Bug
> Components: UDF
> Reporter: Krisztian Kasa
> Assignee: Krisztian Kasa
> Priority: Major
> Labels: pull-request-available
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Both function calls translated to the same UDAF call:
> {code}
> SELECT lead(a, 2, true) ...
> SELECT lead(a, 2) IGNORE NULLS ...
> {code}
> IGNORE NULLS is passed as an extra constant boolean parameter to the UDAF
> https://github.com/apache/hive/blob/eed78dfdcb6dfc2de400397a60de12e6f62b96e2/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ASTConverter.java#L743
> However the semantics of the two function calls has different semantics:
> * *lead(a, 2, true)* - 'true' is the default value: "The value of DEFAULT is
> returned as the result if there is no row corresponding to the OFFSET number
> of rows before R within P (for the lag function) or after R within P (for the
> lead function)"
> * *lead(a, 2) IGNORE NULLS* - For each row in the current window find the 2nd
> not-NULL value starting directly after the current row.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)