velox
velox copied to clipboard
Fix Presto's date_add UDF with TimestampAndTimeZone and DST
Summary: Presto Java's date_add UDF treats the day the clocks move forward as a 23 hour day, and the day the clocks move back as a 25 hour day.
This means for units greater than or equal to a day date_add with TimestampWithTimeZone cannot simply use the addition on GMT. It needs to check if the time zone has changed between the original timestamp and the timestamp after the addition and apply the change in time zone offset to the mills since epoch to account for this long or short day.
Note that the for units less than a day, this does not apply. E.g. if you add 24 hours to a TimestampWithTimeZone and it cross a DST boundary, we do not need to apply the change in offset like you would if you had added 1 day.
Differential Revision: D64982873
This pull request was exported from Phabricator. Differential Revision: D64982873
Deploy Preview for meta-velox canceled.
| Name | Link |
|---|---|
| Latest commit | 3ddb9e08c130d61031fbb65aea36fa5aa141dc79 |
| Latest deploy log | https://app.netlify.com/sites/meta-velox/deploys/6722677506837e00083b477c |
This pull request was exported from Phabricator. Differential Revision: D64982873
This pull request was exported from Phabricator. Differential Revision: D64982873
This pull request was exported from Phabricator. Differential Revision: D64982873
This pull request was exported from Phabricator. Differential Revision: D64982873
This pull request was exported from Phabricator. Differential Revision: D64982873
This pull request was exported from Phabricator. Differential Revision: D64982873
This pull request was exported from Phabricator. Differential Revision: D64982873
This pull request has been merged in facebookincubator/velox@1c0c533cdaee898b0ac479332f7c47af6e950eb7.