forked from facebookincubator/velox
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix formatting of Etc/... time zones in Presto's datetime_format and …
…cast TSwTZ to varchar (facebookincubator#11409) Summary: Pull Request resolved: facebookincubator#11409 The file we use from Joda to generate time zone links (substitutions for certain time zone IDs that we use when formatting) maps various versions of "UTC" to "Etc/GMT" and "Etc/UTC" as these are the official IDs (see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones ). However, Joda also has logic at runtime to remove these prefixes and convert them to "UTC". This leads to Velox producing "Etc/GMT" or "Etc/UTC" when calling datetime_format with the "ZZZ" (or more) pattern and when casting TSwTZ to varchar, while Joda produces "UTC". To keep things simple, I've modified the script that generates our mapping of time zone IDs to simply replace the Etc/GMT and Etc/UTC IDs with "UTC". For cases like parsing, we already call normalizeTimeZone on the time zone ID which does this (among other things), so this is consistent with other places in the code, and, by doing it when generating the map, means we have to do less normalization at runtime. Reviewed By: xiaoxmeng Differential Revision: D65348867 fbshipit-source-id: f39dc397b6c1be87a92aaa7dd93215df64c98b40
- Loading branch information
1 parent
ad27145
commit 8bb3bb9
Showing
3 changed files
with
55 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters