[ 
https://issues.apache.org/jira/browse/HIVE-24865?focusedWorklogId=563998&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-563998
 ]

ASF GitHub Bot logged work on HIVE-24865:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 10/Mar/21 18:59
            Start Date: 10/Mar/21 18:59
    Worklog Time Spent: 10m 
      Work Description: kasakrisz opened a new pull request #2060:
URL: https://github.com/apache/hive/pull/2060


   ### What changes were proposed in this pull request?
   1. Introduce RESPECT NULLS IGNORE NULLS syntax and add it to 
`TOK_WINDOWSPEC` tree
   2. Add ignoreNulls property to `WindowingSpec` and set it in 
`SemanticAnalyzer` during AST traversal.
   3. Set ignoreNull property in `RexOver` in Calcite plan.
   4. Add true literal `ASTNode` as an extra parameter of window function in 
`ASTConverter` when transforming back Calcite plan to AST.  first/last_value 
functions already supports this extra parameter.
   
   ### Why are the changes needed?
   Support specifying ignore nulls in a standard way.
   
   ### Does this PR introduce _any_ user-facing change?
   Yes, but existing behavior not changed. Ignore nulls can be specified two 
ways:
   ```
   Standard: select last_value(b) ignore nulls over
   Legacy:   select last_value(b, true) over
   ```
   
   ### How was this patch tested?
   ```
   mvn test -Dtest.output.overwrite -DskipSparkTests 
-Dtest=TestMiniLlapLocalCliDriver -Dqfile=windowing_navfn.q -pl itests/qtest 
-Pitests
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 563998)
    Time Spent: 20m  (was: 10m)

> Implement Respect/Ignore Nulls in first/last_value
> --------------------------------------------------
>
>                 Key: HIVE-24865
>                 URL: https://issues.apache.org/jira/browse/HIVE-24865
>             Project: Hive
>          Issue Type: New Feature
>          Components: Parser, UDF
>            Reporter: Krisztian Kasa
>            Assignee: Krisztian Kasa
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> {code:java}
> <null treatment> ::=
> RESPECT NULLS | IGNORE NULLS
> <first or last value function> ::=
> <first or last value> <left paren> <value expression> <right paren> [ <null 
> treatment>
> ]
> <first or last value> ::=
> FIRST_VALUE | LAST_VALUE
> {code}
> Example:
> {code:java}
> select last_value(b) ignore nulls over(partition by a order by b) from t1;
> {code}
> Existing non-standard implementation:
> {code:java}
> select last_value(b, true) over(partition by a order by b) from t1;
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to