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

Wenchen Fan resolved SPARK-35169.
---------------------------------
    Fix Version/s: 3.2.0
       Resolution: Fixed

Issue resolved by pull request 32314
[https://github.com/apache/spark/pull/32314]

> Wrong result of min ANSI interval division by -1
> ------------------------------------------------
>
>                 Key: SPARK-35169
>                 URL: https://issues.apache.org/jira/browse/SPARK-35169
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 3.2.0
>            Reporter: Max Gekk
>            Assignee: angerszhu
>            Priority: Major
>             Fix For: 3.2.0
>
>
> The code below portraits the issue:
> {code:scala}
> scala> Seq(java.time.Period.ofMonths(Int.MinValue)).toDF("i").select($"i" / 
> -1).show(false)
> +-------------------------------------+
> |(i / -1)                             |
> +-------------------------------------+
> |INTERVAL '-178956970-8' YEAR TO MONTH|
> +-------------------------------------+
> scala> Seq(java.time.Duration.of(Long.MinValue, 
> java.time.temporal.ChronoUnit.MICROS)).toDF("i").select($"i" / -1).show(false)
> +---------------------------------------------------+
> |(i / -1)                                           |
> +---------------------------------------------------+
> |INTERVAL '-106751991 04:00:54.775808' DAY TO SECOND|
> +---------------------------------------------------+
> {code}
> The result cannot be a negative interval. Spark must throw an overflow 
> exception.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to