Skip to content
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

Disallow timestamp w/ tz values that fall in DST gap or are ambiguous #5781

Open
martint opened this issue Nov 2, 2020 · 3 comments
Open

Comments

@martint
Copy link
Member

martint commented Nov 2, 2020

Operations that result in timestamp w/ tz values that fall in the DST gap or that are ambiguous because of DST transitions should fail with an error.

@findepi
Copy link
Member

findepi commented Nov 2, 2020

Example of an ambiguous value due to DST backwards transition

presto> SELECT from_unixtime(1603589478, 'UTC') AT TIME ZONE 'Europe/Warsaw';
                 _col0
---------------------------------------
 2020-10-25 02:31:18.000 Europe/Warsaw

but:

presto> SELECT from_unixtime(1603589478, 'UTC') AT TIME ZONE 'Europe/Warsaw' = TIMESTAMP '2020-10-25 02:31:18.000 Europe/Warsaw';
 _col0
-------
 false

@dain
Copy link
Member

dain commented Nov 3, 2020

I thought we decided we were using the "lax" rules everywhere in Presto. In that case, gaps get pushed +1 hr, and I don't remember what is chosen for double. If we are changing this, I expect it will be a big deal to implement this everywhere.

@martint
Copy link
Member Author

martint commented Nov 3, 2020

I don't remember ever deciding that, but it's very problematic. It screws up with optimizations the engine could do and produces surprising (incorrect) results, as in the example above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants