yaooqinn opened a new pull request #28637:
URL: https://github.com/apache/spark/pull/28637


   THIS PR BACKPORTS 
https://github.com/apache/spark/commit/695cb617d42507eded9c7e50bc7cd5333bbe6f83 
TO BRANCH-3.0
   
   ### What changes were proposed in this pull request?
   
   Five continuous pattern characters with 'G/M/L/E/u/Q/q' means Narrow-Text 
Style while we turn to use `java.time.DateTimeFormatterBuilder` since 3.0.0, 
which output the leading single letter of the value, e.g. `December` would be 
`D`. In Spark 2.4 they mean Full-Text Style.
   
   In this PR, we explicitly disable Narrow-Text Style for these pattern 
characters.
   
   ### Why are the changes needed?
   
   Without this change, there will be a silent data change.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, queries with datetime operations using datetime patterns, e.g. 
`G/M/L/E/u` will fail if the pattern length is 5 and other patterns, e,g. 'k', 
'm' also can accept a certain number of letters.
   
   1. datetime patterns that are not supported by the new parser but the legacy 
will get SparkUpgradeException, e.g. "GGGGG", "MMMMM", "LLLLL", "EEEEE", 
"uuuuu", "aa", "aaa". 2 options are given to end-users, one is to use legacy 
mode, and the other is to follow the new online doc for correct datetime 
patterns
   
   2, datetime patterns that are not supported by both the new parser and the 
legacy, e.g.  "QQQQQ", "qqqqq",  will get IllegalArgumentException which is 
captured by Spark internally and results NULL to end-users.
   
   ### How was this patch tested?
   
   add unit tests


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

Reply via email to