Joe McDonnell has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/22086 )

Change subject: IMPALA-13523: Decimal Precision needs to be in return type
......................................................................


Patch Set 2:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/22086/2/java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/CommonOperatorFunctions.java
File 
java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/CommonOperatorFunctions.java:

http://gerrit.cloudera.org:8080/#/c/22086/2/java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/CommonOperatorFunctions.java@136
PS2, Line 136:     for (RelDataType r : operandTypes) {
             :       if (r.getSqlTypeName() == SqlTypeName.DECIMAL) {
             :         return r;
             :       }
             :     }
> Errr...well....actually....
Yeah, it turns out my scenario was more obscure than I realized.

I took a look through our built-in functions and basically the only ones I can 
find that take multiple decimals and return a decimal (other than basic 
arithmetic operators) would be greatest(), least(), and mod(). If Calcite is 
already handling those, then the only thing really remaining would be UDFs. In 
that case, I'm ok with bailing out when there are multiple decimals.

We could revisit this later. I think adding a UDF with (decimal, decimal) -> 
decimal is doable for testing purposes. Probably we should have something like 
that anyway independent of Calcite.



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie10521b587a74930a01c08b711364f897bb2dc33
Gerrit-Change-Number: 22086
Gerrit-PatchSet: 2
Gerrit-Owner: Steve Carlin <[email protected]>
Gerrit-Reviewer: Aman Sinha <[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: Thu, 23 Jan 2025 02:07:54 +0000
Gerrit-HasComments: Yes

Reply via email to