vvysotskyi commented on a change in pull request #1451: DRILL-6710: Drill C++
Client does not handle scale = 0 properly for d…
URL: https://github.com/apache/drill/pull/1451#discussion_r213595435
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/planner/types/decimal/DecimalScalePrecisionModFunction.java
##########
@@ -40,5 +40,6 @@ public void computeScalePrecision(int leftPrecision, int
leftScale, int rightPre
// Output precision should atleast be greater or equal to the input
precision
outputPrecision = Math.max(outputPrecision, Math.max(leftPrecision,
rightPrecision));
Review comment:
Looks like it is a mistake and should be used `min` instead of the first
`max`:
```
outputPrecision = Math.min(outputPrecision, Math.max(leftPrecision,
rightPrecision));
```
because the current code returns either
`DRILL_REL_DATATYPE_SYSTEM.getMaxNumericPrecision()` or greater number.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services