yaooqinn commented on a change in pull request #28646:
URL: https://github.com/apache/spark/pull/28646#discussion_r430912333
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeFormatterHelper.scala
##########
@@ -217,9 +217,18 @@ private object DateTimeFormatterHelper {
toFormatter(builder, TimestampFormatter.defaultLocale)
}
+ final val bugInStandAloneForm = {
+ // Java 8 has a bug for stand-alone form. See
https://bugs.openjdk.java.net/browse/JDK-8114833
+ // Note: we only check the US locale so that it's a static check. It can
produce false-negative
+ // as some locales are not affected by the bug. Since `L` is rarely used,
we choose to not
+ // complicate the check here.
+ // TODO: remove it when we drop Java 8 support.
+ val formatter = DateTimeFormatter.ofPattern("LLL", Locale.US)
+ formatter.format(LocalDate.of(2000, 1, 1)) == "1"
+ }
final val unsupportedLetters = Set('A', 'c', 'e', 'n', 'N', 'p')
final val unsupportedNarrowTextStyle =
- Set("GGGGG", "MMMMM", "LLLLL", "EEEEE", "uuuuu", "QQQQQ", "qqqqq", "uuuuu")
+ Seq("G", "M", "L", "E", "u", "Q", "q").map(_ * 5).toSet
Review comment:
Maybe we can remove duplicated check for 'L' and 'q' here
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]