Aleksandr Efimov has posted comments on this change. ( http://gerrit.cloudera.org:8080/24709 )
Change subject: IMPALA-15269: Decimal operands in comparisons do not need casting ...................................................................... Patch Set 4: (1 comment) One question - I think I'm missing where the new operator reaches the convertlet. http://gerrit.cloudera.org:8080/#/c/24709/4/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/24709/4/java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaCustomOperatorTable.java@235 PS4, Line 235: public static final SqlBinaryOperator EQUALS = I traced this one a few times and I think I'm missing a step - could you help me see it? The way I read it, the SqlCall that reaches the convertlet still carries SqlStdOperatorTable.EQUALS: BinaryRowOperator() in our Parser.jj returns the std instance for <EQ> (same for <NE> and IS [NOT] DISTINCT FROM), while <PLUS> and friends return the ImpalaCustomOperatorTable ones, and after parsing nothing re-resolves binary operators - performUnconditionalRewrites only goes to the operator table for SqlUnresolvedFunction. The registration is fine either way, since SqlOperator.equals() is (class, name, kind) and both are SqlBinaryOperator "=" / SqlKind.EQUALS, so registerOp() matches the std call and convertEquals() does run. But StandardConvertletTable.convertCall() picks the consistency off call.getOperator().getOperandTypeChecker(), which would still be the UNORDERED checker with LEAST_RESTRICTIVE, so the leastRestrictive cast looks like it would still be inserted. That same equality is probably why PLUS/MINUS/MULTIPLY/DIVIDE are handed out by the parser: they are the same class as Calcite's and differ only in the inference, so the instance in the call is what counts. Did a Parser.jj hunk get lost in a rebase? If the new calcite.test query did pass in your e2e run, then I have something wrong here and I'd like to know where the operator gets swapped. -- To view, visit http://gerrit.cloudera.org:8080/24709 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I226e4a7d105e963f3263fb8a71acb5fdef7ffa94 Gerrit-Change-Number: 24709 Gerrit-PatchSet: 4 Gerrit-Owner: Steve Carlin <[email protected]> Gerrit-Reviewer: Aleksandr Efimov <[email protected]> Gerrit-Reviewer: Aman Sinha <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Jason Fehr <[email protected]> Gerrit-Reviewer: Joe McDonnell <[email protected]> Gerrit-Reviewer: Michael Smith <[email protected]> Gerrit-Comment-Date: Sun, 23 Aug 2026 13:59:25 +0000 Gerrit-HasComments: Yes
