[ 
https://issues.apache.org/jira/browse/SPARK-34695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17299014#comment-17299014
 ] 

Apache Spark commented on SPARK-34695:
--------------------------------------

User 'MaxGekk' has created a pull request for this issue:
https://github.com/apache/spark/pull/31799

> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to