-
Notifications
You must be signed in to change notification settings - Fork 25k
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
SQL: Custom timezone is not used in CAST/CONVERT #40692
Comments
Pinging @elastic/es-search |
@matriv I am not convinced about the first part. I've tested PostgreSQL and the timezone is not outputted for something like |
@astefan But you cast a well defined timestamp at a custom timezone and you get back the same exact timestamp but with indication UTC. |
@elastic/es-ql |
Looks like the bug has been resolved in the meantime. I cannot reproduce it on 7.14.0 anymore:
So the timezone has been considered but the result is still presented in UTC and not in the time zone provided with the |
The second part is still present though:
But the output should probably be equivalent to specifying the time zone in the query:
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
SELECT CAST('2019-01-14T12:29:25.000+05:00' AS DATETIME)
returns2019-01-14T12:29:25.000Z` instead of `+05:00
Also the whole CASTING/ESCAPE literals should be revisited as
UTC
is always used.So if the client uses a custom timezone and uses a filter like:
SELECT * FROM t WHERE created = CAST('2019-01-14T12:29:25.000' AS DATETIME)
the date literal will be in UTC which I think is not what the client would expect.Also simple
SELECT CAST('2019-01-14T12:29:25.000' AS DATETIME)
should convert it to the timezone set by the client and not UTC.The text was updated successfully, but these errors were encountered: