mgaido91 commented on a change in pull request #23000: [SPARK-26002][SQL] Fix 
day of year calculation for Julian calendar days
URL: https://github.com/apache/spark/pull/23000#discussion_r242452051
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala
 ##########
 @@ -53,14 +53,27 @@ object DateTimeUtils {
 
   final val MILLIS_PER_DAY = SECONDS_PER_DAY * 1000L
 
-  // number of days in 400 years
+  // number of days in 400 years by Gregorian calendar
   final val daysIn400Years: Int = 146097
+
+  // In Julian calendar every year which is a multiple of 4 is a leap year.
+  // So in 400 years there are 3 extra leap years compared to the Gregorian 
calendar:
+  // 100, 200 and 300 (as multiples of 100 but not 400).
 
 Review comment:
   +1, some kind of rewording of:
   ```
   The Gregorian calendar has the same months and month lengths as the Julian 
calendar, but, in the Gregorian calendar, year numbers evenly divisible by 100 
are not leap years, except that those evenly divisible by 400 remain leap years.
   ```
   would be great here IMHO

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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