Linhong Liu created SPARK-60651:
-----------------------------------
Summary: Allow decimal remainders with integral quotients wider
than the math context
Key: SPARK-60651
URL: https://issues.apache.org/jira/browse/SPARK-60651
Project: Spark
Issue Type: Bug
Components: SQL
Affects Versions: 5.0.0
Reporter: Linhong Liu
Decimal remainder can throw ArithmeticException: Division impossible when the
integral quotient exceeds the 39-digit MathContext, even though the remainder
is representable. For example, the remainder of
99999999999999999999999999999999999999 divided by 0.0007 is 0.0004, and pmod of
its negative by 0.0007 is 0.0003. Preserve the existing context-based operation
for successful inputs and retry with exact remainder only if that operation
throws. Keep zero-divisor handling unchanged. Regression coverage includes both
signs, remainder and pmod, quotient precision boundaries, zero divisors, scale
preservation, and extreme-scale cases that already succeed with the existing
operation.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]