Description
A decimal logical type with an underlying fixed bytes type is invalid if the precision is greater than can be contained in the fixed bytes. The calculation for
max precision can return a wrong value when the fixed bytes size is greater than 128.
For a fixed size of 129, the Math.pow(2, 8 * size - 1) part of this formula will return Double.INFINITY, and the max precision will be considered Long.MAX_VALUE. The expected value is 310 digits precision.
We can apply the log power rule to avoid overflow, or some bit-twiddling approximation (like java.math.BigDecimal).
Attachments
Issue Links
- links to