[ 
https://issues.apache.org/jira/browse/FLINK-41056?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18131579#comment-18131579
 ] 

Sergey Nuyanzin commented on FLINK-41056:
-----------------------------------------

Merged as 
[9b8faccb8842a6be4f84e3f71da7c82b0c499e00|https://github.com/apache/flink/commit/9b8faccb8842a6be4f84e3f71da7c82b0c499e00]

> 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
>            Priority: Major
>              Labels: pull-request-available
>
> "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
(v10.3.26#10030026)

Reply via email to