You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "HyukjinKwon (via GitHub)" <gi...@apache.org> on 2023/09/25 03:20:32 UTC

[GitHub] [spark] HyukjinKwon opened a new pull request, #43085: [SPARK-45300][SQL][TESTS] Remove JDK 8 workaround in TimestampFormatterSuite

HyukjinKwon opened a new pull request, #43085:
URL: https://github.com/apache/spark/pull/43085

   ### What changes were proposed in this pull request?
   
   This PR removes the legacy workaround for JDK 8 in https://github.com/apache/spark/pull/28736. 
   
   ### Why are the changes needed?
   
   - We still need the main code for completeness, and in case there are other diff in the future JDK versions so this PR only fixes the tests.
   - We dropped JDK 11/8 at SPARK-44112
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Fixed unittests.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   No.
   


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] HyukjinKwon commented on a diff in pull request #43085: [SPARK-45300][SQL][TESTS] Remove JDK 8 workaround in TimestampFormatterSuite

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on code in PR #43085:
URL: https://github.com/apache/spark/pull/43085#discussion_r1335359916


##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/TimestampFormatterSuite.scala:
##########
@@ -333,14 +333,8 @@ 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".
-      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))
-      }
+      intercept[DateTimeException](formatter.parse("2009-12-12 12 am"))

Review Comment:
   cc @wangyum from https://github.com/apache/spark/commit/412d86e711188ff1bd8a6387524131aa3c200503



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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] dongjoon-hyun commented on pull request #43085: [SPARK-45300][SQL][TESTS] Remove JDK 8 workaround in TimestampFormatterSuite

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #43085:
URL: https://github.com/apache/spark/pull/43085#issuecomment-1734761857

   I manually verified this. Merged to master.
   ```
   $ build/sbt "catalyst/testOnly *.TimestampFormatterSuite"
   ...
   [info] TimestampFormatterSuite:
   [info] - explicitly forbidden datetime patterns (355 milliseconds)
   [info] - SPARK-31939: Fix Parsing day of year when year field pattern is missing (50 milliseconds)
   [info] - parsing timestamps using time zones (2 milliseconds)
   [info] - format timestamps using time zones (6 milliseconds)
   [info] - roundtrip micros -> timestamp -> micros using timezones (22 milliseconds)
   [info] - roundtrip timestamp -> micros -> timestamp using timezones (8 milliseconds)
   [info] - case insensitive parsing of am and pm (5 milliseconds)
   [info] - format fraction of second (1 millisecond)
   [info] - formatting negative years with default pattern (3 milliseconds)
   [info] - parsing timestamp strings with various seconds fractions (8 milliseconds)
   [info] - formatting timestamp strings up to microsecond precision (4 milliseconds)
   [info] - SPARK-30958: parse timestamp with negative year (2 milliseconds)
   [info] - SPARK-31557: rebasing in legacy formatters/parsers (10 milliseconds)
   [info] - parsing hour with various patterns (3 milliseconds)
   [info] - missing date fields (0 milliseconds)
   [info] - missing year field with invalid date (1 millisecond)
   [info] - missing am/pm field (1 millisecond)
   [info] - missing time fields (1 millisecond)
   [info] - missing hour field (0 milliseconds)
   [info] - check result differences for datetime formatting (0 milliseconds)
   [info] - SPARK-32424: avoid silent data change when timestamp overflows (1 millisecond)
   [info] - SPARK-36418: default parsing w/o pattern (5 milliseconds)
   [info] - SPARK-39193: support returning optional parse results in the default formatter (2 milliseconds)
   [info] - SPARK-39280: support returning optional parse results in the iso8601 formatter (0 milliseconds)
   [info] - SPARK-39281: support returning optional parse results in the legacy formatter (0 milliseconds)
   [info] Run completed in 1 second, 193 milliseconds.
   [info] Total number of tests run: 25
   [info] Suites: completed 1, aborted 0
   [info] Tests: succeeded 25, failed 0, canceled 0, ignored 0, pending 0
   [info] All tests passed.
   [success] Total time: 27 s, completed Sep 25, 2023, 8:14:13 PM
   ```


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] HyukjinKwon commented on pull request #43085: [SPARK-45300][SQL][TESTS] Remove JDK 8 workaround in TimestampFormatterSuite

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on PR #43085:
URL: https://github.com/apache/spark/pull/43085#issuecomment-1732843175

   cc @yaooqinn


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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


[GitHub] [spark] dongjoon-hyun closed pull request #43085: [SPARK-45300][SQL][TESTS] Remove JDK 8 workaround in TimestampFormatterSuite

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun closed pull request #43085: [SPARK-45300][SQL][TESTS] Remove JDK 8 workaround in TimestampFormatterSuite
URL: https://github.com/apache/spark/pull/43085


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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