You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/10/04 06:24:38 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #25998: [SPARK-29328][SQL] Fix calculation of mean seconds per month

cloud-fan commented on a change in pull request #25998: [SPARK-29328][SQL] Fix calculation of mean seconds per month
URL: https://github.com/apache/spark/pull/25998#discussion_r331355205
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/EventTimeWatermark.scala
 ##########
 @@ -28,9 +27,7 @@ object EventTimeWatermark {
   val delayKey = "spark.watermarkDelayMs"
 
   def getDelayMs(delay: CalendarInterval): Long = {
-    // We define month as `31 days` to simplify calculation.
-    val millisPerMonth = TimeUnit.MICROSECONDS.toMillis(CalendarInterval.MICROS_PER_DAY) * 31
-    delay.milliseconds + delay.months * millisPerMonth
+    delay.milliseconds + delay.months * MILLIS_PER_MONTH
 
 Review comment:
   What we need here is seconds per month, not seconds per year. I think we should still assume 31 days per month here.

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


With regards,
Apache Git Services

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