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/04/07 09:07:10 UTC
[GitHub] [spark] HyukjinKwon commented on a change in pull request #28137:
[SPARK-31361][SQL] Rebase datetime in parquet/avro according to file
written Spark version
HyukjinKwon commented on a change in pull request #28137: [SPARK-31361][SQL] Rebase datetime in parquet/avro according to file written Spark version
URL: https://github.com/apache/spark/pull/28137#discussion_r404654496
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceUtils.scala
##########
@@ -64,4 +66,10 @@ object DataSourceUtils {
private[sql] def isDataFile(fileName: String) =
!(fileName.startsWith("_") || fileName.startsWith("."))
+
+ def needRebaseDateTime(lookupFileMeta: String => String): Option[Boolean] = {
+ // If there is no version, we return None and let the caller side to decide.
+ // Files written by Spark 3.0 and later follow the new calendar and don't need to rebase.
+ Option(lookupFileMeta(SPARK_VERSION_METADATA_KEY)).map(_ < "3.0")
Review comment:
I don't think we guarantee forward compatibility - things from Spark 2.4 should work in Spark 3.0 but I don't think the opposite case is guaranteed.
----------------------------------------------------------------
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