-
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 Presto's date_diff UDF with TimestampAndTimeZone and DST #11380
Fix Presto's date_diff UDF with TimestampAndTimeZone and DST #11380
Conversation
✅ Deploy Preview for meta-velox canceled.
|
This pull request was exported from Phabricator. Differential Revision: D65165953 |
…kincubator#11380) Summary: Presto Java's date_diff UDF respects DST for units greater than or equal to a day, but for units less than a day computes the diff on the system time (GMT). This means for units less than a day date_diff with TimestampWithTimeZone cannot compute the difference of the local times. It needs to use system time to be consistent. Note that the for units greater than or equal to a day, this does not apply, and we should continue to use the local time to compute the difference. This is analogous to the change made to date_add in facebookincubator#11353 Differential Revision: D65165953
4fab016
to
9240144
Compare
This pull request was exported from Phabricator. Differential Revision: D65165953 |
…incubator#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 compute the addition based on the local time to handle these. Note that the for units less than a day, this does not apply, and will produce incorrect results if we compute it using local time. Reviewed By: xiaoxmeng Differential Revision: D64982873
…kincubator#11380) Summary: Presto Java's date_diff UDF respects DST for units greater than or equal to a day, but for units less than a day computes the diff on the system time (GMT). This means for units less than a day date_diff with TimestampWithTimeZone cannot compute the difference of the local times. It needs to use system time to be consistent. Note that the for units greater than or equal to a day, this does not apply, and we should continue to use the local time to compute the difference. This is analogous to the change made to date_add in facebookincubator#11353 Reviewed By: xiaoxmeng Differential Revision: D65165953
9240144
to
dad4d83
Compare
This pull request was exported from Phabricator. Differential Revision: D65165953 |
This pull request has been merged in 7377bc8. |
Conbench analyzed the 1 benchmark run on commit There were no benchmark performance regressions. 🎉 The full Conbench report has more details. |
Summary:
Presto Java's date_diff UDF respects DST for units greater than or equal to a day, but
for units less than a day computes the diff on the system time (GMT).
This means for units less than a day date_diff with TimestampWithTimeZone cannot
compute the difference of the local times. It needs to use system time to be
consistent.
Note that the for units greater than or equal to a day, this does not apply, and we
should continue to use the local time to compute the difference.
This is analogous to the change made to date_add in
#11353
Differential Revision: D65165953