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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]