[ 
https://issues.apache.org/jira/browse/SPARK-61439?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Max Gekk updated SPARK-61439:
-----------------------------
    Description: 
MultiplyYMInterval and MultiplyDTInterval call Math.multiplyExact / 
Math.toIntExact directly, so an overflow raises a plain 
java.lang.ArithmeticException, without an error condition or a query context, 
in every mode. For example:

{code:sql}
SELECT interval 2147483647 month * 2;
{code}

fails with a bare "integer overflow" (see interval.sql.out), while the matching 
division raises INTERVAL_ARITHMETIC_OVERFLOW with a context (SPARK-60746, 
SPARK-61352).

The multiplication should raise INTERVAL_ARITHMETIC_OVERFLOW through 
IntervalMathUtils, taking the context from a SupportQueryContext field, as the 
division does after SPARK-61352, so that it survives serialization to 
executors. SPARK-61196 covers add, subtract and negate.

> Raise INTERVAL_ARITHMETIC_OVERFLOW with a query context for an overflowing 
> interval multiplication
> --------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-61439
>                 URL: https://issues.apache.org/jira/browse/SPARK-61439
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 5.0.0
>            Reporter: Max Gekk
>            Priority: Major
>
> MultiplyYMInterval and MultiplyDTInterval call Math.multiplyExact / 
> Math.toIntExact directly, so an overflow raises a plain 
> java.lang.ArithmeticException, without an error condition or a query context, 
> in every mode. For example:
> {code:sql}
> SELECT interval 2147483647 month * 2;
> {code}
> fails with a bare "integer overflow" (see interval.sql.out), while the 
> matching division raises INTERVAL_ARITHMETIC_OVERFLOW with a context 
> (SPARK-60746, SPARK-61352).
> The multiplication should raise INTERVAL_ARITHMETIC_OVERFLOW through 
> IntervalMathUtils, taking the context from a SupportQueryContext field, as 
> the division does after SPARK-61352, so that it survives serialization to 
> executors. SPARK-61196 covers add, subtract and negate.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

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

Reply via email to