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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]