Aman Sinha has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/25137 )

Change subject: IMPALA-14947: Calcite planner: fix parsing issues
......................................................................


Patch Set 5:

(7 comments)

http://gerrit.cloudera.org:8080/#/c/25137/5/java/calcite-planner/src/main/codegen/config.fmpp
File java/calcite-planner/src/main/codegen/config.fmpp:

http://gerrit.cloudera.org:8080/#/c/25137/5/java/calcite-planner/src/main/codegen/config.fmpp@56
PS5, Line 56:     "AVG"
I am unclear why AVG and RANK are listed in the nonReservedKeyWords.  What's 
special about these versus other Aggregate or Analytical functions ?


http://gerrit.cloudera.org:8080/#/c/25137/5/java/calcite-planner/src/main/codegen/config.fmpp@470
PS5, Line 470:     "< BITAND_OPERATOR: \"&\" >"
In addition, how about bitwise OR  i.e '|' , and logical OR i.e '||' ? 
Corresponding to 'DIV', there's also 'MOD' for the remainder.  All these are in 
the category of binary operators tokens.   Can these be added ?


http://gerrit.cloudera.org:8080/#/c/25137/5/java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaConvertletTable.java
File 
java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaConvertletTable.java:

http://gerrit.cloudera.org:8080/#/c/25137/5/java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaConvertletTable.java@144
PS5, Line 144:     if (call.operandCount() > 2) {
This checks for operand count > 2 which could mean any number greater than 2 
but only operand(2) is looked at.  What if there are additional operands ?  
Those would get ignored. If this should be exactly 3 operands, then this should 
be more explicit .. something like:
 if (call.operandCount() == 3) {
 ..
} else if (call.operandCount() <= 2) {
 ..
} else {
  Assert  invalid operand count
}
Also, if this format expr is only valid for DATE formatting,  I would have 
expected a check for DATE type somewhere here...WDYT ?


http://gerrit.cloudera.org:8080/#/c/25137/5/java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaCustomOperatorTable.java
File 
java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaCustomOperatorTable.java:

http://gerrit.cloudera.org:8080/#/c/25137/5/java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaCustomOperatorTable.java@192
PS5, Line 192:   // UNARY_MINUS is the same as the one in Calcite. We need it in
This comment seems wrongly placed .. it is about the MINUS operator whereas you 
are adding the FACTORIAL.


http://gerrit.cloudera.org:8080/#/c/25137/5/java/calcite-planner/src/main/java/org/apache/impala/calcite/type/ImpalaTypeSystemImpl.java
File 
java/calcite-planner/src/main/java/org/apache/impala/calcite/type/ImpalaTypeSystemImpl.java:

http://gerrit.cloudera.org:8080/#/c/25137/5/java/calcite-planner/src/main/java/org/apache/impala/calcite/type/ImpalaTypeSystemImpl.java@231
PS5, Line 231: op == ArithmeticExpr.Operator.INT_DIVIDE;
It is not clear why nullability of a result of an arithmetic expr would depend 
on this INT_DIVIDE operator.  Nullability derivation depends on whether one of 
the arguments is nullable which seems to be captured by type1, type2 checks 
already.  BTW, you might want to check Calcite utility functions .. I would 
expect that there are existing utils for nullability derivation of arithmetic 
exprs.


http://gerrit.cloudera.org:8080/#/c/25137/5/testdata/workloads/functional-query/queries/QueryTest/fallback_planner.test
File 
testdata/workloads/functional-query/queries/QueryTest/fallback_planner.test:

http://gerrit.cloudera.org:8080/#/c/25137/5/testdata/workloads/functional-query/queries/QueryTest/fallback_planner.test@83
PS5, Line 83: # query used to not compile in Calcite, Calcite currently expects 
ignore nulls to be
            : # outside the parens. But this has been fixed.
The mention of 'Calcite currently expects ..'  seems confusing since you have 
already fixed that behavior in a prior patch, so it no longer current.  Should 
this be simply 'Test for ignore nulls within parens syntax'.


http://gerrit.cloudera.org:8080/#/c/25137/5/testdata/workloads/functional-query/queries/QueryTest/fallback_planner.test@95
PS5, Line 95: # query used to not compile in Calcite, Calcite currently expects 
ignore nulls to be
            : # outside the parens. But this has been fixed.
Sane as above.



--
To view, visit http://gerrit.cloudera.org:8080/25137
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I5e275f1b0b1f4895a12ac6251e91a39408815a75
Gerrit-Change-Number: 25137
Gerrit-PatchSet: 5
Gerrit-Owner: Steve Carlin <[email protected]>
Gerrit-Reviewer: Aleksandr Efimov <[email protected]>
Gerrit-Reviewer: Aman Sinha <[email protected]>
Gerrit-Reviewer: Fang-Yu Rao <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Joe McDonnell <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>
Gerrit-Reviewer: Steve Carlin <[email protected]>
Gerrit-Comment-Date: Sun, 25 Oct 2026 03:23:41 +0000
Gerrit-HasComments: Yes

Reply via email to