Maksim Zhuravkov created IGNITE-22061:
-----------------------------------------

             Summary: Sql. Use compact representation of BigDecimal with large 
scale for integers / numbers with trailing zeros
                 Key: IGNITE-22061
                 URL: https://issues.apache.org/jira/browse/IGNITE-22061
             Project: Ignite
          Issue Type: Improvement
          Components: sql
            Reporter: Maksim Zhuravkov


BigDecimals that represent integer numbers can take up a lot of space, when 
scale is specified:
{code:java}
 BigDecimal dc = new BigDecimal("11111111").setScale(1024, 
RoundingMode.HALF_UP);
        System.out.println("Difference:");
        System.out.println(MarshallerUtil.sizeInBytes(dc) - 
dc.stripTrailingZeros().setScale(0, 
RoundingMode.HALF_UP).unscaledValue().toByteArray().length);
{code}
The code prints:
{code}
Difference:
427
{code}
Let's update BinaryTuple format to store such numbers in more compact form that 
ignores trailing zeros.




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to