You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/03/10 18:59:02 UTC

[GitHub] [hive] kasakrisz opened a new pull request #2060: HIVE-24865: Implement Respect/Ignore Nulls in first/last_value

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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] kasakrisz commented on a change in pull request #2060: HIVE-24865: Implement Respect/Ignore Nulls in first/last_value

Posted by GitBox <gi...@apache.org>.
kasakrisz commented on a change in pull request #2060:
URL: https://github.com/apache/hive/pull/2060#discussion_r592059837



##########
File path: parser/src/java/org/apache/hadoop/hive/ql/parse/HiveLexerParent.g
##########
@@ -376,6 +376,8 @@ KW_PKFK_JOIN: 'PKFK_JOIN';
 KW_LEADING: 'LEADING';
 KW_TRAILING: 'TRAILING';
 KW_TRIM: 'TRIM';
+KW_IGNORE: 'IGNORE';

Review comment:
       These are non-reserved keywords: added `Respect` to the list, `Ignore` was already there but it was not defined in the lexer before this patch.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] kasakrisz merged pull request #2060: HIVE-24865: Implement Respect/Ignore Nulls in first/last_value

Posted by GitBox <gi...@apache.org>.
kasakrisz merged pull request #2060:
URL: https://github.com/apache/hive/pull/2060


   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] jcamachor commented on a change in pull request #2060: HIVE-24865: Implement Respect/Ignore Nulls in first/last_value

Posted by GitBox <gi...@apache.org>.
jcamachor commented on a change in pull request #2060:
URL: https://github.com/apache/hive/pull/2060#discussion_r591794461



##########
File path: parser/src/java/org/apache/hadoop/hive/ql/parse/HiveLexerParent.g
##########
@@ -376,6 +376,8 @@ KW_PKFK_JOIN: 'PKFK_JOIN';
 KW_LEADING: 'LEADING';
 KW_TRAILING: 'TRAILING';
 KW_TRIM: 'TRIM';
+KW_IGNORE: 'IGNORE';

Review comment:
       Are 'ignore' and 'respect' treated as SQL keywords?




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org