dongjoon-hyun commented on a change in pull request #28646:
URL: https://github.com/apache/spark/pull/28646#discussion_r430508310
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeFormatterHelper.scala
##########
@@ -217,9 +217,15 @@ private object DateTimeFormatterHelper {
toFormatter(builder, TimestampFormatter.defaultLocale)
}
+ lazy val bugInStandAloneForm = {
+ val formatter = DateTimeFormatter.ofPattern("LLL", Locale.US)
+ // JDK 8 has a bug for stand-alone form. See
https://bugs.openjdk.java.net/browse/JDK-8114833
Review comment:
Thank you for adding this pointer.
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeFormatterHelper.scala
##########
@@ -244,6 +250,12 @@ private object DateTimeFormatterHelper {
for (style <- unsupportedNarrowTextStyle if
patternPart.contains(style)) {
throw new IllegalArgumentException(s"Too many pattern letters:
${style.head}")
}
+ if (bugInStandAloneForm && (patternPart.contains("LLL") ||
patternPart.contains("qqq"))) {
+ throw new IllegalArgumentException("The current JDK has a bug to
support stand-alone " +
Review comment:
Maybe, `JDK` -> `Java` because there is JRE environment, too?
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeFormatterHelper.scala
##########
@@ -244,6 +250,12 @@ private object DateTimeFormatterHelper {
for (style <- unsupportedNarrowTextStyle if
patternPart.contains(style)) {
throw new IllegalArgumentException(s"Too many pattern letters:
${style.head}")
}
+ if (bugInStandAloneForm && (patternPart.contains("LLL") ||
patternPart.contains("qqq"))) {
+ throw new IllegalArgumentException("The current JDK has a bug to
support stand-alone " +
Review comment:
What do you mean by `not related to JRE`?
`DateTimeFormatter.ofPattern("LLL", Locale.US)` is working correctly on JRE or
`DateTimeFormatter.ofPattern("LLL", Locale.US)` is absent in JRE?
----------------------------------------------------------------
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]