Steve Carlin 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; : } : } > Yeah, it turns out my scenario was more obscure than I realized. I originally saw that greatest/least function, but in the prototype, it only had one arg. Sigh, but yeah, it's a "vararg" which takes multiple params. The mod one is already taken into account with the binary operations. But the greatest/least functions were crashing. I made a more general change to make sure casting is done to the return type in the case of "case" statements and these varargs statements. I wasn't quite sure how to special case the greatest/least functions but felt the varargs way was the most generic, since any varargs function will probably require the decimal types to be the same. -- 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: Fri, 24 Jan 2025 20:47:58 +0000 Gerrit-HasComments: Yes
