chunweilei commented on a change in pull request #1108: [CALCITE-863] support
RESPECT NULLS, IGNORE NULLS option for lead, lag function
URL: https://github.com/apache/calcite/pull/1108#discussion_r266242648
##########
File path: core/src/main/codegen/templates/Parser.jj
##########
@@ -5678,8 +5679,19 @@ SqlNode NamedFunctionCall() :
args.remove(0);
}
)
+ [
+ (
+ <IGNORE> { s1 = span(); } <NULLS> {
+ ignoreNulls = SqlLiteral.createBoolean(true, s1.end(this));
+ }
+ |
+ <RESPECT> { s1 = span(); } <NULLS> {
+ ignoreNulls = SqlLiteral.createBoolean(false, s1.end(this));
+ }
+ )
+ ]
{
- call = createCall(qualifiedName, s.end(this), funcType, quantifier,
args);
+ call = createCall(qualifiedName, s.end(this), funcType, quantifier,
ignoreNulls, args);
Review comment:
Thank you for your suggestion. With my understanding, if doing like that,
the first operand of `RexOver` may become `RESPECT_NULLS(AGG)` or
`IGNORE_NULLS(AGG)` instead of `AGG`. It looks like more reasonable and I would
like to try it.
----------------------------------------------------------------
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]
With regards,
Apache Git Services