HyukjinKwon commented on code in PR #36937:
URL: https://github.com/apache/spark/pull/36937#discussion_r902238147
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala:
##########
@@ -237,7 +237,13 @@ object DateTimeUtils {
* Converts milliseconds since the epoch to microseconds.
*/
def millisToMicros(millis: Long): Long = {
- Math.multiplyExact(millis, MICROS_PER_MILLIS)
+ if (millis < MIN_MICROS) {
+ Long.MinValue
+ } else if (millis > MAX_MICROS) {
+ Long.MaxValue
+ } else {
+ Math.multiplyExact(millis, MICROS_PER_MILLIS)
Review Comment:
Doesn't `multiplyExact` throw an exception when overflow happens?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]