Steve Carlin 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)

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 he
Ah, ok.

So the tests do pass.  But I put in something that wasn't needed. I need to 
figure out what is best to do now.

I figured that by overriding the operator, it would automatically assign it the 
custom operator, but as you mentioned, Parser.jj assigns the 
SqlStdOperatorTable.EQUALS.

The reason the tests work is the validator deriveType method is what is used to 
call leastRestrictive.  When deriveType is called, it again goes to the 
operator table, but in this case, it finds the 
ImpalaCustomOperatorTable.EQUALS. So it chooses the right the ORDERED checker 
here, avoids leastRestrictive, and avoids the casting of the operands.

So if I remove the Convertlet, it still works.

I'll need to figure out what to do here.  Not sure at this point.



--
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-Reviewer: Steve Carlin <[email protected]>
Gerrit-Comment-Date: Sun, 23 Aug 2026 14:31:10 +0000
Gerrit-HasComments: Yes

Reply via email to