yaooqinn commented on a change in pull request #31799:
URL: https://github.com/apache/spark/pull/31799#discussion_r592129047
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/IntervalUtils.scala
##########
@@ -779,9 +782,14 @@ object IntervalUtils {
* @throws ArithmeticException If numeric overflow occurs
*/
def durationToMicros(duration: Duration): Long = {
- val us = Math.multiplyExact(duration.getSeconds, MICROS_PER_SECOND)
- val result = Math.addExact(us, duration.getNano / NANOS_PER_MICROS)
- result
+ val seconds = duration.getSeconds
+ if (seconds == minDurationSeconds) {
+ val us = (minDurationSeconds + 1) * MICROS_PER_SECOND
Review comment:
nit: microseconds
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]