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_r406108658
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/RebaseDateTime.scala
 ##########
 @@ -97,51 +105,26 @@ object RebaseDateTime {
     -390750, -354226, -317702, -244653, -208129, -171605, -141427)
 
   /**
-   * Rebasing days since the epoch to store the same number of days
-   * as by Spark 2.4 and earlier versions. Spark 3.0 switched to
-   * Proleptic Gregorian calendar (see SPARK-26651), and as a consequence of 
that,
-   * this affects dates before 1582-10-15. Spark 2.4 and earlier versions use
-   * Julian calendar for dates before 1582-10-15. So, the same local date may
-   * be mapped to different number of days since the epoch in different 
calendars.
+   * Converts the given number of days since the epoch day 1970-01-01 to a 
local date in Proleptic
+   * Gregorian calendar, interprets the result as a local date in Julian 
calendar, and take the
+   * number of days since the epoch from the Julian local date.
+   *
+   * 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:
    *   Proleptic Gregorian calendar: 1582-01-01 -> -141714
    *   Julian calendar: 1582-01-01 -> -141704
    * The code below converts -141714 to -141704.
    *
-   * @param days The number of days since the epoch 1970-01-01. It can be 
negative.
+   * @param days The number of days since the epoch in Gregorian calendar. It 
can be negative.
    * @return The rebased number of days since the epoch in Julian calendar.
    */
   def rebaseGregorianToJulianDays(days: Int): Int = {
     rebaseDays(gregJulianDiffSwitchDay, gregJulianDiffs, days)
   }
 
-  /**
-   * Converts the given microseconds to a local date-time in UTC time zone in 
Proleptic Gregorian
-   * calendar, interprets the result as a local date-time in Julian calendar 
in UTC time zone.
-   * And takes microseconds since the epoch from the Julian timestamp.
-   *
-   * @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 Proleptic Gregorian calendar. It can be negative.
-   * @return The rebased microseconds since the epoch in Julian calendar.
-   */
-  private[sql] def rebaseGregorianToJulianMicros(zoneId: ZoneId, micros: 
Long): Long = {
 
 Review comment:
   move it closer to its optimized version.

----------------------------------------------------------------
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]

Reply via email to