cloud-fan commented on a change in pull request #27915: [WIP][SPARK-31159][SQL] 
Rebase date/timestamp from/to Julian calendar in parquet
URL: https://github.com/apache/spark/pull/27915#discussion_r392932105
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetRowConverter.scala
 ##########
 @@ -296,6 +317,15 @@ private[parquet] class ParquetRowConverter(
           }
         }
 
+      case DateType if rebaseDateTime =>
+        new ParquetPrimitiveConverter(updater) {
+          override def addInt(value: Int): Unit = {
+            val rebased = DateTimeUtils.rebaseJulianToGregorianDays(value)
+            // DateType is not specialized in `SpecificMutableRow`, have to 
box it here.
+            updater.set(rebased.asInstanceOf[DateType#InternalType])
 
 Review comment:
   what's the error if we simply write `updater.set(rebased)` here?

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