Skip to content

Commit 421138f

Browse files
committed
Added another test to check trailing spaces
1 parent 17edc79 commit 421138f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,12 +456,18 @@ class DateTimeUtilsSuite extends SparkFunSuite with Matchers {
456456
}
457457
}
458458

459-
test("trailing characters while converting string to timestamp") {
459+
test("trailing colon while converting string to timestamp") {
460460
val s = UTF8String.fromString("2019-10-31T10:59:23Z:::")
461461
val time = DateTimeUtils.stringToTimestamp(s, defaultZoneId)
462462
assert(time == None)
463463
}
464464

465+
test("trailing space while converting string to timestamp") {
466+
val s = UTF8String.fromString("2019-10-31T10:59:23ZZ ")
467+
val time = DateTimeUtils.stringToTimestamp(s, defaultZoneId)
468+
assert(time == None)
469+
}
470+
465471
test("truncTimestamp") {
466472
def testTrunc(
467473
level: Int,

0 commit comments

Comments
 (0)