Ted Yu created SPARK-34532: ------------------------------ Summary: IntervalUtils.add() may result in 'long overflow' Key: SPARK-34532 URL: https://issues.apache.org/jira/browse/SPARK-34532 Project: Spark Issue Type: Bug Components: Spark Core Affects Versions: 3.0.2 Reporter: Ted Yu
I noticed the following when running test suite: {code} 19:15:38.255 ERROR org.apache.spark.executor.Executor: Exception in task 0.0 in stage 14744.0 (TID 16705) java.lang.ArithmeticException: long overflow at java.lang.Math.addExact(Math.java:809) at org.apache.spark.sql.types.LongExactNumeric$.plus(numerics.scala:105) at org.apache.spark.sql.types.LongExactNumeric$.plus(numerics.scala:104) at org.apache.spark.sql.catalyst.expressions.Add.nullSafeEval(arithmetic.scala:268) at org.apache.spark.sql.catalyst.expressions.BinaryExpression.eval(Expression.scala:573) at org.apache.spark.sql.catalyst.expressions.InterpretedMutableProjection.apply(InterpretedMutableProjection.scala:97) {code} This likely was caused by the following line: {code} val microseconds = left.microseconds + right.microseconds {code} We should check whether the addition would produce overflow before adding. -- 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