cloud-fan commented on a change in pull request #27915: [SPARK-31159][SQL]
Rebase date/timestamp from/to Julian calendar in parquet
URL: https://github.com/apache/spark/pull/27915#discussion_r394175508
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetIOSuite.scala
##########
@@ -879,6 +880,70 @@ class ParquetIOSuite extends QueryTest with ParquetTest
with SharedSparkSession
assert(metaData.get(SPARK_VERSION_METADATA_KEY) === SPARK_VERSION_SHORT)
}
}
+
+ test("SPARK-31159: compatibility with Spark 2.4 in reading
dates/timestamps") {
+ Seq(false, true).foreach { vectorized =>
+ withSQLConf(SQLConf.PARQUET_VECTORIZED_READER_ENABLED.key ->
vectorized.toString,
+ SQLConf.LEGACY_PARQUET_REBASE_DATETIME.key -> "true") {
+ checkAnswer(
+
readResourceParquetFile("test-data/before_1582_date_v2_4.snappy.parquet"),
+ Row(java.sql.Date.valueOf("1001-01-01")))
+ checkAnswer(readResourceParquetFile(
+ "test-data/before_1582_timestamp_micros_v2_4.snappy.parquet"),
+ Row(java.sql.Timestamp.valueOf("1001-01-01 01:02:03.123456")))
+ checkAnswer(readResourceParquetFile(
+ "test-data/before_1582_timestamp_millis_v2_4.snappy.parquet"),
+ Row(java.sql.Timestamp.valueOf("1001-01-01 01:02:03.123")))
+ }
+ checkAnswer(readResourceParquetFile(
Review comment:
we should still test it with or without vectorized reader.
----------------------------------------------------------------
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]