You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/03/13 08:35:14 UTC

[GitHub] [spark] MaxGekk commented on a change in pull request #27890: [SPARK-31076][SQL][FOLLOWUP] Incapsulate date rebasing to `DaysWritable`

MaxGekk commented on a change in pull request #27890: [SPARK-31076][SQL][FOLLOWUP] Incapsulate date rebasing to `DaysWritable`
URL: https://github.com/apache/spark/pull/27890#discussion_r392090623
 
 

 ##########
 File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveInspectors.scala
 ##########
 @@ -646,14 +617,7 @@ private[hive] trait HiveInspectors {
         case x: DateObjectInspector if x.preferWritable() =>
           data: Any => {
             if (data != null) {
-              // Rebasing written days via conversion to local dates.
-              // See the comment for `getDateWritable()`.
-              val daysSinceEpoch = x.getPrimitiveWritableObject(data).getDays
-              if (daysSinceEpoch < JULIAN_CUTOVER_DAY) {
-                rebaseJulianToGregorianDays(daysSinceEpoch)
-              } else {
-                daysSinceEpoch
-              }
+              x.getPrimitiveWritableObject(data).getDays
 
 Review comment:
   You are right, `DateWritable` can come here. I have fixed that by adding new constructor to `DaysWritable` to construct its instances from `DateWritable`. 

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


With regards,
Apache Git Services

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