-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Presto's date_add UDF with TimestampAndTimeZone and DST (#11353)
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
- Loading branch information
1 parent
e67f11b
commit 97ec37f
Showing
4 changed files
with
186 additions
and
53 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
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