dongjoon-hyun commented on a change in pull request #34153:
URL: https://github.com/apache/spark/pull/34153#discussion_r721880795



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeFormatterHelper.scala
##########
@@ -322,6 +323,13 @@ private object DateTimeFormatterHelper {
             (isParsing && unsupportedLettersForParsing.contains(c))) {
             throw new IllegalArgumentException(s"Illegal pattern character: 
$c")
           }
+          // SPARK-36796: `select date_format('2018-11-17 13:33:33.333', 'B')` 
failed with Java 8,
+          // but use Java 17 will return `in the afternoon` because 'B' is 
used to represent
+          // `Pattern letters to output a day period` in Java 17 and disabled 
it here for
+          // compatibility with Java 8 behavior.
+          for (c <- patternPart if unknownPatternLetters.contains(c)) {

Review comment:
       Could you make this a separate PR please, @LuciferYang ? We can merge it 
first before this.

##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeFormatterHelper.scala
##########
@@ -322,6 +323,13 @@ private object DateTimeFormatterHelper {
             (isParsing && unsupportedLettersForParsing.contains(c))) {
             throw new IllegalArgumentException(s"Illegal pattern character: 
$c")
           }
+          // SPARK-36796: `select date_format('2018-11-17 13:33:33.333', 'B')` 
failed with Java 8,
+          // but use Java 17 will return `in the afternoon` because 'B' is 
used to represent
+          // `Pattern letters to output a day period` in Java 17 and disabled 
it here for
+          // compatibility with Java 8 behavior.
+          for (c <- patternPart if unknownPatternLetters.contains(c)) {

Review comment:
       Could you make this a separate PR please, @LuciferYang ? We can merge 
that first before this.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to