mgaido91 opened a new pull request #25010: [SPARK-28201][SQL] Revisit 
MakeDecimal behavior on overflow
URL: https://github.com/apache/spark/pull/25010
 
 
   ## What changes were proposed in this pull request?
   
   In SPARK-23179, it has been introduced a flag to control the behavior in 
case of overflow on decimals. The behavior is: returning `null` when 
`spark.sql.decimalOperations.nullOnOverflow` (default and traditional Spark 
behavior); throwing an `ArithmeticException` if that conf is false (according 
to SQL standards, other DBs behavior).
   
   `MakeDecimal` so far had an ambiguous behavior. In case of codegen mode, it 
returned `null` as the other operators, but in interpreted mode, it was 
throwing an `IllegalArgumentException`.
   
   The PR aligns `MakeDecimal`'s behavior with the one of other operators as 
defined in SPARK-23179. So now both modes return `null` or throw 
`ArithmeticException` according to 
`spark.sql.decimalOperations.nullOnOverflow`'s value.
   
   ## How was this patch tested?
   
   improved UTs

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to