-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fix format_datetime to used linked TimeZone names #11337
Fix format_datetime to used linked TimeZone names #11337
Conversation
✅ Deploy Preview for meta-velox canceled.
|
This pull request was exported from Phabricator. Differential Revision: D64870014 |
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.
@kevinwilfong thanks!
…or#11283) Summary: Pull Request resolved: facebookincubator#11283 The format_datetime currently outptus the time zone id if for 3 or fewer 'z' characters in the format string. However, the JODA library, which this is based on, does this for 3 or more 'Z' characters. https://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html This diff fixes this, as well as adds support for a single 'Z' (which outputs the same thing as 'ZZ' just without the colon). So 'Z' is fully supported for any number of characters. Differential Revision: D64500193
This pull request was exported from Phabricator. Differential Revision: D64870014 |
…11337) Summary: Pull Request resolved: facebookincubator#11337 JODA has this concept of linked Time Zones where given a particular time zone ID, it will write out a different time zone ID when formatting a timestamp as a string (I suspect this is for historical reasons). More information is available about this here https://github.com/JodaOrg/global-tz This diff adds a script to parse the file JODA uses to get these links and turn it into a static map. I've done this for the file in the version of JODA Presto Java currently uses (there have been significant updates in more recent versions). Note that the file guarantees there are no transitive links so we don't need to handle that case. I then updated the format_datetime UDF to use this mapping for the ZZZ (or more) pattern. It will use the linked time zone ID in place of the time zone ID if one is available. This is also fixes casting TimestampWithTimeZone to Varchar which uses the same code path. Reviewed By: xiaoxmeng Differential Revision: D64870014
cf0e9ae
to
bdeba8a
Compare
…11337) Summary: Pull Request resolved: facebookincubator#11337 JODA has this concept of linked Time Zones where given a particular time zone ID, it will write out a different time zone ID when formatting a timestamp as a string (I suspect this is for historical reasons). More information is available about this here https://github.com/JodaOrg/global-tz This diff adds a script to parse the file JODA uses to get these links and turn it into a static map. I've done this for the file in the version of JODA Presto Java currently uses (there have been significant updates in more recent versions). Note that the file guarantees there are no transitive links so we don't need to handle that case. I then updated the format_datetime UDF to use this mapping for the ZZZ (or more) pattern. It will use the linked time zone ID in place of the time zone ID if one is available. This is also fixes casting TimestampWithTimeZone to Varchar which uses the same code path. Reviewed By: xiaoxmeng Differential Revision: D64870014
This pull request was exported from Phabricator. Differential Revision: D64870014 |
bdeba8a
to
8bbd3c3
Compare
This pull request was exported from Phabricator. Differential Revision: D64870014 |
…11337) Summary: Pull Request resolved: facebookincubator#11337 JODA has this concept of linked Time Zones where given a particular time zone ID, it will write out a different time zone ID when formatting a timestamp as a string (I suspect this is for historical reasons). More information is available about this here https://github.com/JodaOrg/global-tz This diff adds a script to parse the file JODA uses to get these links and turn it into a static map. I've done this for the file in the version of JODA Presto Java currently uses (there have been significant updates in more recent versions). Note that the file guarantees there are no transitive links so we don't need to handle that case. I then updated the format_datetime UDF to use this mapping for the ZZZ (or more) pattern. It will use the linked time zone ID in place of the time zone ID if one is available. This is also fixes casting TimestampWithTimeZone to Varchar which uses the same code path. Reviewed By: xiaoxmeng Differential Revision: D64870014
8bbd3c3
to
cb7f4ab
Compare
…11337) Summary: Pull Request resolved: facebookincubator#11337 JODA has this concept of linked Time Zones where given a particular time zone ID, it will write out a different time zone ID when formatting a timestamp as a string (I suspect this is for historical reasons). More information is available about this here https://github.com/JodaOrg/global-tz This diff adds a script to parse the file JODA uses to get these links and turn it into a static map. I've done this for the file in the version of JODA Presto Java currently uses (there have been significant updates in more recent versions). Note that the file guarantees there are no transitive links so we don't need to handle that case. I then updated the format_datetime UDF to use this mapping for the ZZZ (or more) pattern. It will use the linked time zone ID in place of the time zone ID if one is available. This is also fixes casting TimestampWithTimeZone to Varchar which uses the same code path. Reviewed By: xiaoxmeng Differential Revision: D64870014
cb7f4ab
to
547c86a
Compare
This pull request was exported from Phabricator. Differential Revision: D64870014 |
This pull request has been merged in b1834bd. |
Conbench analyzed the 1 benchmark run on commit There were no benchmark performance regressions. 🎉 The full Conbench report has more details. |
Summary:
JODA has this concept of linked Time Zones where given a particular time zone ID, it
will write out a different time zone ID when formatting a timestamp as a string (I
suspect this is for historical reasons).
More information is available about this here https://github.com/JodaOrg/global-tz
This diff adds a script to parse the file JODA uses to get these links and turn it into a
static map. I've done this for the file in the version of JODA Presto Java currently uses
(there have been significant updates in more recent versions). Note that the file
guarantees there are no transitive links so we don't need to handle that case.
I then updated the format_datetime UDF to use this mapping for the ZZZ (or more)
pattern. It will use the linked time zone ID in place of the time zone ID if one is
available.
This is also fixes casting TimestampWithTimeZone to Varchar which uses the same
code path.
Differential Revision: D64870014