[
https://issues.apache.org/jira/browse/SPARK-28224?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mick Jermsurawong updated SPARK-28224:
--------------------------------------
Summary: Check overflow in decimal Sum aggregate (was: Sum aggregation
returns null on overflow decimals)
> Check overflow in decimal Sum aggregate
> ---------------------------------------
>
> Key: SPARK-28224
> URL: https://issues.apache.org/jira/browse/SPARK-28224
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 3.0.0
> Reporter: Mick Jermsurawong
> Priority: Major
>
> To reproduce:
> {code:java}
> import spark.implicits._
> val ds = spark
> .createDataset(Seq(BigDecimal("1" * 20), BigDecimal("9" * 20)))
> .agg(sum("value"))
> .as[BigDecimal]
> ds.collect shouldEqual Seq(null){code}
> Given the option to throw exception on overflow on, sum aggregation of
> overflowing bigdecimal still remain null. {{DecimalAggregates}} is only
> invoked when expression of the sum (not the elements to be operated) has
> sufficiently small precision. The fix seems to be in Sum expression itself.
>
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]