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

Yahya Kisana commented on SPARK-60205:
--------------------------------------

I can take this

> Decimal.set(unscaled, precision, scale) reports the previous value instead of 
> the rejected one on overflow
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-60205
>                 URL: https://issues.apache.org/jira/browse/SPARK-60205
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.5.8, 4.2.0, 4.3.0, 4.1.3, 4.0.4, 4.4.0
>            Reporter: L. C. Hsieh
>            Priority: Major
>
> `Decimal.set(unscaled: Long, precision: Int, scale: Int)` throws 
> `unscaledValueTooLargeForPrecisionError(this, precision, scale)` after 
> `setOrNull` returns null. `setOrNull` returns before writing any field, so 
> `this` still holds its previous value, which is 0 for a new `Decimal`. For 
> example, `Decimal(123456L, 3, 0)` throws "0 cannot be represented as 
> Decimal(3, 0)". Callers include `MakeDecimal` under ANSI and 
> `AvroDeserializer.createDecimal`. The error should build the value from 
> `unscaled` and `scale`.
> Found in the review of SPARK-60119.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to