Skip to content

Commit 7a4cf9e

Browse files
author
Marcelo Vanzin
committed
And a test.
1 parent 6064ef2 commit 7a4cf9e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,11 +428,14 @@ class DateTimeUtilsSuite extends SparkFunSuite {
428428
}
429429

430430
test("SPARK-10439: bound checks") {
431-
// Avoid truncation when converting from ms to us.
431+
// Avoid truncation when converting from ms to us. Make sure dates are within allowed range.
432432
Seq(JLong.MIN_VALUE, JLong.MAX_VALUE).foreach { ts =>
433433
intercept[IllegalArgumentException] {
434434
fromJavaTimestamp(new Timestamp(ts))
435435
}
436+
intercept[IllegalArgumentException] {
437+
fromJavaDate(new Date(ts))
438+
}
436439
}
437440

438441
// Make sure calculated nanos are positive, since that's what the Hive/Impala timestamp spec

0 commit comments

Comments
 (0)