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

Value cannot be cast to timestamp for the beginning of the Daylight saving time #11729

Closed
mbasmanova opened this issue Oct 17, 2018 · 3 comments

Comments

@mbasmanova
Copy link
Contributor

Presto fails to cast the timestamp representing the beginning of the Daylight saving time:

presto> select cast(varchar '2017-03-12 02:00:00' as timestamp);
Query 20181017_170049_38639_mwuxk failed: Value cannot be cast to timestamp: 2017-03-12 02:00:00
@rschlussel
Copy link
Contributor

what would the correct behavior be? 2am does not exist on the day we switch to DST. The same way you can't have a timestamp 2017-03-12 24:00:00.

@haozhun
Copy link
Contributor

haozhun commented Oct 17, 2018

This is a known issue. It should work because "TIMESTAMP" should have LocalDateTime semantics. However, "TIMESTAMP" in Hive has Instant semantics. Presto screwed up and gave "TIMESTAMP" Instant semantics. With Instant semantics, failing is the right behavior. (Potentially, there could be a lenient version in a function.)

This code will work if the new semantics is turned on. But the new semantics is not ready due to lack of connector support. And the new semantics is completely different.

See #10326

@findepi
Copy link
Contributor

findepi commented Oct 17, 2018

Closing in favor of #7122 and #10326

@findepi findepi closed this as completed Oct 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants