Sergey Nuyanzin created FLINK-41056:
---------------------------------------

             Summary: Keep non-compact decimals with unscaled value fitting in 
a long as long to avoid BigDecimal on read, add, subtract, cast and deserialize
                 Key: FLINK-41056
                 URL: https://issues.apache.org/jira/browse/FLINK-41056
             Project: Flink
          Issue Type: Technical Debt
          Components: Table SQL / Runtime
            Reporter: Sergey Nuyanzin
            Assignee: Sergey Nuyanzin


"Fits in a long" means that integer unscaled is within 
{{Long.MIN_VALUE...Long.MAX_VALUE}}. The fraction is always exact, because the 
scale comes from the type and is never rounded away.

  Compact decimals (precision <= 18) already work this way through {{longVal}}. 
The change lets a non-compact value use it too, whenever its unscaled value 
happens to be small enough. {{BigDecimal}} does the same internally with
  intCompact and scale.



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

Reply via email to