-
Notifications
You must be signed in to change notification settings - Fork 3k
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 #191
Comments
Hey all, I've got a question on this I'm hoping you can help with. I work at Looker/Google so I am trying to update our SQL syntax for timezones based on the newer versions of this change. Our timezone implementations for conversion use the named timezones -- 'America/Los_Angeles'. So a lot of our SQL looks like:
and such. Looks like this issue was intended to remove support for those values. But I think I also might be misinterpreting. Does this mean named values should never be used in Trino/PrestoSQL syntax anymore? And everything should be using offsets like Because these queries still work on 341+: |
Political timezones are still supported for the |
Ahh, thank you very much. I should read more carefully 😄 |
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
time with time zone
should be represented asOffsetTime
The text was updated successfully, but these errors were encountered: