Aleksandr Efimov has posted comments on this change. ( 
https://gerrit.cloudera.org/25024 )

Change subject: IMPALA-15486: Fix DECIMAL scale result types
......................................................................


Patch Set 4:

(1 comment)

https://gerrit.cloudera.org/#/c/25024/4/java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaAdjustScaleFunction.java
File 
java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaAdjustScaleFunction.java:

https://gerrit.cloudera.org/#/c/25024/4/java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaAdjustScaleFunction.java@104
PS4, Line 104:       int resultScale = Math.max(0, 
Math.min(decimalType.decimalScale(), scale));
             :       int integerDigits = decimalType.decimalPrecision() - 
decimalType.decimalScale();
             :       // Rounding can carry only when reducing the fractional 
scale.
             :       if ((getName().equals("ROUND") || 
getName().equals("DROUND"))
             :           && resultScale < decimalType.decimalScale()) {
             :         ++integerDigits;
             :       }
> There is an issue with negative scales for round. round(cast(9995 as decima
Fixed in PS5 for both planners. ROUND/DROUND now keep the carry digit for 
negative scales, capped at precision 38. Added type and value tests.



--
To view, visit https://gerrit.cloudera.org/25024
To unsubscribe, visit https://gerrit.cloudera.org/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I8f6e6e2eaa7fe6eeab88b4143ed6b73e65220333
Gerrit-Change-Number: 25024
Gerrit-PatchSet: 4
Gerrit-Owner: Aleksandr Efimov <[email protected]>
Gerrit-Reviewer: Aleksandr Efimov <[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: Mon, 02 Nov 2026 08:59:55 +0000
Gerrit-HasComments: Yes

Reply via email to