Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add a test
  • Loading branch information
MaxGekk committed Mar 25, 2020
commit a2a081a11655e0622973e75658a7f5830a0ff6fb
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,16 @@ abstract class OrcSuite extends OrcTest with BeforeAndAfterAll {
}
}
}

test("SPARK-31238: compatibility with Spark 2.4 in reading dates") {
Seq(false, true).foreach { vectorized =>
withSQLConf(SQLConf.ORC_VECTORIZED_READER_ENABLED.key -> vectorized.toString) {
checkAnswer(
readResourceOrcFile("test-data/before_1582_date_v2_4.snappy.orc"),
Row(java.sql.Date.valueOf("1200-01-01")))
}
}
}
}

class OrcSourceSuite extends OrcSuite with SharedSparkSession {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,9 @@ abstract class OrcTest extends QueryTest with FileBasedDataSourceTest with Befor
throw new AnalysisException("Can not match OrcTable in the query.")
}
}

protected def readResourceOrcFile(name: String): DataFrame = {
val url = Thread.currentThread().getContextClassLoader.getResource(name)
spark.read.orc(url.toString)
}
}