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/03/10 17:48:00 UTC

[jira] [Assigned] (SPARK-34695) Overflow in round trip conversion from micros to duration

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

Apache Spark reassigned SPARK-34695:
------------------------------------

    Assignee:     (was: Apache Spark)

> Overflow in round trip conversion from micros to duration
> ---------------------------------------------------------
>
>                 Key: SPARK-34695
>                 URL: https://issues.apache.org/jira/browse/SPARK-34695
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 3.2.0
>            Reporter: Maxim Gekk
>            Priority: Major
>
> The code below fails with long overflow:
> {code:scala}
> scala> import org.apache.spark.sql.catalyst.util.IntervalUtils._
> import org.apache.spark.sql.catalyst.util.IntervalUtils._
> scala> val minDuration = microsToDuration(Long.MinValue)
> minDuration: java.time.Duration = PT-2562047788H-54.775808S
> scala> durationToMicros(minDuration)
> java.lang.ArithmeticException: long overflow
>   at java.lang.Math.multiplyExact(Math.java:892)
>   at org.apache.spark.sql.catalyst.util.IntervalUtils$.durationToMicros(IntervalUtils.scala:782)
>   ... 49 elided
> {code}



--
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