You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (Jira)" <ji...@apache.org> on 2021/04/23 10:46:00 UTC

[jira] [Assigned] (SPARK-35169) Wrong result of min ANSI interval division by -1

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

Apache Spark reassigned SPARK-35169:
------------------------------------

    Assignee:     (was: Apache Spark)

> 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
>            Priority: Major
>
> 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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org