gengliangwang commented on a change in pull request #32839:
URL: https://github.com/apache/spark/pull/32839#discussion_r648076780
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala
##########
@@ -385,8 +385,10 @@ object DateTimeUtils {
* microseconds where microsecond 0 is 1970-01-01 00:00:00Z.
*/
def instantToMicros(instant: Instant): Long = {
- val us = Math.multiplyExact(instant.getEpochSecond, MICROS_PER_SECOND)
- val result = Math.addExact(us, NANOSECONDS.toMicros(instant.getNano))
+ // we don't need to take care overflow here, since if overflow occurred,
Review comment:
I don't think this is the right fix. The range of
`instant.getEpochSecond` is [-31557014167219200L, 31556889864403199L]
--
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]