sohami 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_r213733265
##########
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:
From [design
document](https://docs.google.com/document/d/1kfWUZ_OsEmLOJu_tKZO0-ZUJwc52drrm15fyif7BmzQ/edit#)
there is a note which says Drill computes scale/precision for mod function
differently and formula is as below. Not sure what the reason was. Also the
comment above that line says precision should be atleast equal or greater than
input precision. So if max of input precision is > 38 then that will be chosen
as precision, if < 38 then a greater number 38 will be chosen. Do you still
think this is a bug?
```
For mod function resulting precision also differs:
p = Max(range(Max(s1,s2)+p1-s1),Max(p1,p2))
```
----------------------------------------------------------------
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