cloud-fan commented on a change in pull request #27618: [SPARK-30869][SQL] 
Convert dates to/from timestamps in microseconds precision
URL: https://github.com/apache/spark/pull/27618#discussion_r382448360
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala
 ##########
 @@ -147,7 +147,7 @@ object DateTimeUtils {
    * Converts milliseconds since epoch to SQLTimestamp.
    */
   def millisToMicros(millis: Long): SQLTimestamp = {
-    MILLISECONDS.toMicros(millis)
+    Math.multiplyExact(millis, MICROS_PER_MILLIS)
 
 Review comment:
   I'm surprised `MILLISECONDS.toMicros` is not overflow-safe. AFAIK we use 
these utils in many places...

----------------------------------------------------------------
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]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to