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

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

Maxim Gekk created SPARK-34695:
----------------------------------

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


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