zhztheplayer 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_r266195059
##########
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:
Sorry I haven't tested the code but Is it possible to make `{ RESPECT |
IGNORE } NULLS` clause an individual operator? There are already some operators
for similar agg-specific clauses such as `OVER` / `FILTER` / `WITHIN GROUP`.
----------------------------------------------------------------
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