HyukjinKwon commented on a change in pull request #28172:
URL: https://github.com/apache/spark/pull/28172#discussion_r415664502



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/RebaseDateTime.scala
##########
@@ -66,15 +66,53 @@ object RebaseDateTime {
   // The starting point is the `0001-01-01` (-719164 days since the epoch in
   // Julian calendar). All dates before the staring point have the same 
difference
   // of 2 days in Julian and Proleptic Gregorian calendars.
+  // Rebasing switch days and diffs `julianGregDiffSwitchDay` and 
`julianGregDiffs`
+  // was generated by the `localRebaseJulianToGregorianDays` function.
   private val julianGregDiffSwitchDay = Array(
     -719164, -682945, -646420, -609895, -536845, -500320, -463795,
     -390745, -354220, -317695, -244645, -208120, -171595, -141427)
 
+  // The first days of Common Era (CE) which is mapped to the '0001-01-01' 
date in Julian calendar.
+  private final val julianCommonEraStartDay = julianGregDiffSwitchDay(0)
+
   /**
    * Converts the given number of days since the epoch day 1970-01-01 to a 
local date in Julian
    * calendar, interprets the result as a local date in Proleptic Gregorian 
calendar, and takes the
    * number of days since the epoch from the Gregorian local date.
    *
+   * @param days The number of days since the epoch in Julian calendar. It can 
be negative.
+   * @return The rebased number of days in Gregorian calendar.
+   */
+  private[sql] def localRebaseJulianToGregorianDays(days: Int): Int = {

Review comment:
       nit: let's avoid to use `private[sql]`, next time.




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



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

Reply via email to