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/12/14 16:29:08 UTC

[GitHub] [spark] srowen commented on a change in pull request #30754: [SPARK-33771][SQL][TESTS] Fix Invalid value for HourOfAmPm when testing on JDK 14

srowen commented on a change in pull request #30754:
URL: https://github.com/apache/spark/pull/30754#discussion_r542522263



##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/TimestampFormatterSuite.scala
##########
@@ -355,9 +356,14 @@ class TimestampFormatterSuite extends DatetimeFormatterSuite {
       val micros1 = formatter.parse("2009-12-12 00 am")
       assert(micros1 === date(2009, 12, 12))
 
+      // JDK-8223773: DateTimeFormatter Fails to throw an Exception on Invalid HOUR_OF_AMPM
       // For `KK`, "12:00:00 am" is the same as "00:00:00 pm".
-      val micros2 = formatter.parse("2009-12-12 12 am")
-      assert(micros2 === date(2009, 12, 12, 12))
+      if (SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_13)) {
+        intercept[DateTimeException](formatter.parse("2009-12-12 12 am"))
+      } else {
+        val micros2 = formatter.parse("2009-12-12 12 am")
+        assert(micros2 === date(2009, 12, 12, 12))
+      }

Review comment:
       I think this is OK.




----------------------------------------------------------------
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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org