-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-31879][SQL] Using GB as default Locale for datetime formatters #28692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -117,7 +117,16 @@ class LegacySimpleDateFormatter(pattern: String, locale: Locale) extends LegacyD | |
| object DateFormatter { | ||
| import LegacyDateFormats._ | ||
|
|
||
| val defaultLocale: Locale = Locale.US | ||
| /** | ||
| * This is change from Locale.US to GB, because: | ||
| * The first day-of-week varies by culture. | ||
| * For example, the US uses Sunday, while the United Kingdom and the ISO-8601 standard use Monday. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this the only difference between US and en-GB?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems that we don't need care about the other differences, e.g. currency symbol the timeZone is not the same, but it's a separate field we don't get it from Locale right?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there any localized timezone related pattern letter?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have |
||
| * | ||
| * Using `US` makes functions which rely on the Locale to express the first day of week | ||
| * inconsistent with Spark 2.4 | ||
| * see https://issues.apache.org/jira/browse/SPARK-31879 | ||
| */ | ||
| val defaultLocale: Locale = new Locale("en", "GB") | ||
|
|
||
| val defaultPattern: String = "yyyy-MM-dd" | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -164,3 +164,5 @@ select from_csv('26/October/2015', 'date Date', map('dateFormat', 'dd/MMMMM/yyyy | |
| select from_unixtime(1, 'yyyyyyyyyyy-MM-dd'); | ||
| select date_format(timestamp '2018-11-17 13:33:33', 'yyyyyyyyyy-MM-dd HH:mm:ss'); | ||
| select date_format(date '2018-11-17', 'yyyyyyyyyyy-MM-dd'); | ||
|
|
||
| select to_timestamp('2020-01-01', 'YYYY-ww-uu'); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we use formatting in the test? so this doesn't conflict with #28706 |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make the doc shorter