cloud-fan commented on a change in pull request #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#discussion_r406136677
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/RebaseDateTime.scala
##########
@@ -256,14 +270,23 @@ object RebaseDateTime {
}
/**
- * Converts the given microseconds to a local date-time in UTC time zone in
the hybrid
- * calendar (Julian + Gregorian since 1582-10-15), interprets the result as
a local date-time
- * in Proleptic Gregorian calendar in UTC time zone. And takes microseconds
since the epoch
- * from the Gregorian timestamp.
+ * Converts the given number of microseconds since the epoch
'1970-01-01T00:00:00Z', to a local
+ * date-time in Julian calendar with timezone identified by `zoneId`,
interprets the result as a
+ * local date-time in Proleptic Gregorian calendar with the same timezone,
and takes microseconds
+ * since the epoch from the Gregorian local date-time.
+ *
+ * This is used to guarantee backward compatibility, as Spark 2.4 and
earlier versions use
+ * Julian calendar for dates before 1582-10-15, while Spark 3.0 and later
use Proleptic Gregorian
+ * calendar. See SPARK-26651.
+ *
+ * For example:
+ * Julian calendar: 1582-01-01 00:00:00.123456 -> -12243196799876544
+ * Proleptic Gregorian calendar: 1582-01-01 00:00:00.123456 ->
-12244061221876544
+ * The code below converts -12243196799876544 to -12244061221876544.
*
* @param zoneId The time zone ID at which the rebasing should be performed.
* @param micros The number of microseconds since the epoch
'1970-01-01T00:00:00Z'
- * in the hybrid calendar (Julian + Gregorian). It can be
negative.
+ * in the Julian calendar. It can be negative.
Review comment:
The rebase mostly happens before 1582, so Julian calenday is OK. The method
name is also `JulianToGregorian`.
----------------------------------------------------------------
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]