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_r382415344
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala
 ##########
 @@ -88,14 +86,14 @@ object DateTimeUtils {
    * Returns the number of days since epoch from java.sql.Date.
    */
   def fromJavaDate(date: Date): SQLDate = {
-    millisToDays(date.getTime)
+    microsToDays(Math.multiplyExact(date.getTime, MICROS_PER_MILLIS))
 
 Review comment:
   shall we call `millisToMicros(date.getTime)` instead of 
`Math.multiplyExact(date.getTime, MICROS_PER_MILLIS)`?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to