-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Remove support for political time zones from TIME WITH TIME ZONE #10103
Comments
@martint some questions:
|
i think the answer lies in https://prestodb.io/docs/current/release/release-0.206.html - we foretold the changes will be for non-legacy timestamp |
(EDITED on 7/26: changed my answers materially)
I don't feel strongly. But I prefer only applying it to new timestamp. I have always just assumed this, and I haven't thought about the complexity this carries. Therefore, I'm willing to change my opinion if you have a preference.
Prepend today's date (not 1970-01-01), and then convert to current session zone (not its offset). Let the conversion logic handle gaps and overlaps.
I assume that you are thinking about one of the following two alternatives. Path 1. TIMESTAMP -> TIMESTAMP WITH TIME ZONE -> TIME WITH TIME ZONE Both path has down sides. I prefer path 1. cc @dain |
for the last two items |
I am unsure what the complexity will ultimately be. What comes to my mind is what will let's try to make it guarded with the
Indeed, this is what the spec suggests. Now, we fill date fields with 1970-01-01 (in all casts from TIME* to TIMESTAMP*). I will add this to the roadmap issue.
Path 1 is also what spec seems to be saying. |
TIME WITH TIME ZONE
can express such (probably) useful things like02:23:00+02:00
(= pair of 23 minutes past 2am, offset +2h).However, it can also represent such things like
02:23:00 Europe/Warsaw
, which sounds like a cool feature at first, but its semantics are problematic -- you can't reliably convert this to TIME in any zone (like UTC), since a named zone doesn't need to have fixed zone offset (due to DST and policy changes over time). (Probably for these reasons, Java Time API hasLocalTime
andOffsetTime
but nothing likeZonedTime
exists.)As discussed offline some time ago, we should:
Some details:
TIME '.... Continent/City'
andTIME '.... PST'
literals should failTIME / TIME TZ at time zone ....
should fail for non-offset tzcast(timestamp tz as time tz)
should take current (as of this timestamp’s instant) tz offset and producetime with tz offset
cast(time as time tz)
should take current session time zone’s current offset and producetime with tz offset
Relates to the on-going #7122 (doing this one before #7122 will cause conflicts but may simplify our lives significantly)
cc @losipiuk @martint @dain @electrum @haozhun
The text was updated successfully, but these errors were encountered: