Skip to content

SQL: Columns of type DATETIME are returned always at UTC #40152

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

Closed
matriv opened this issue Mar 18, 2019 · 1 comment · Fixed by #40163
Closed

SQL: Columns of type DATETIME are returned always at UTC #40152

matriv opened this issue Mar 18, 2019 · 1 comment · Fixed by #40163
Assignees
Labels

Comments

@matriv
Copy link
Contributor

matriv commented Mar 18, 2019

The timezone set by the client (REST, JDBC, ODBC) is not used when selecting columns of data type DATETIME, instead UTC is always used. E.g.:

-- timezone set to 'Etc/GMT-10'
SELECT created FROM test;

        created
------------------------
2016-01-01T00:00:00.000Z

The same issue (UTC is always used) occurs also for all grouping queries

@matriv matriv added >bug :Analytics/SQL SQL querying labels Mar 18, 2019
@matriv matriv self-assigned this Mar 18, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

matriv added a commit to matriv/elasticsearch that referenced this issue Mar 18, 2019
When selecting columns of ES type `date` (SQL's DATETIME) the
`FieldHitExtractor` was not using the timezone of the client session
but always resorted to UTC. The same behaviour (UTC only) was
encountered also for grouping keys (`CompositeKeyExtractor`) and
for First/Last functions on dates (`TopHitsAggExtractor`).

Fixes: elastic#40152
matriv added a commit that referenced this issue Mar 20, 2019
When selecting columns of ES type `date` (SQL's DATETIME) the
`FieldHitExtractor` was not using the timezone of the client session
but always resorted to UTC. The same behaviour (UTC only) was
encountered also for grouping keys (`CompositeKeyExtractor`) and
for First/Last functions on dates (`TopHitsAggExtractor`).

Fixes: #40152
matriv added a commit that referenced this issue Mar 20, 2019
When selecting columns of ES type `date` (SQL's DATETIME) the
`FieldHitExtractor` was not using the timezone of the client session
but always resorted to UTC. The same behaviour (UTC only) was
encountered also for grouping keys (`CompositeKeyExtractor`) and
for First/Last functions on dates (`TopHitsAggExtractor`).

Fixes: #40152
matriv added a commit that referenced this issue Mar 20, 2019
When selecting columns of ES type `date` (SQL's DATETIME) the
`FieldHitExtractor` was not using the timezone of the client session
but always resorted to UTC. The same behaviour (UTC only) was
encountered also for grouping keys (`CompositeKeyExtractor`) and
for First/Last functions on dates (`TopHitsAggExtractor`).

Fixes: #40152
matriv added a commit that referenced this issue Mar 20, 2019
When selecting columns of ES type `date` (SQL's DATETIME) the
`FieldHitExtractor` was not using the timezone of the client session
but always resorted to UTC. The same behaviour (UTC only) was
encountered also for grouping keys (`CompositeKeyExtractor`) and
for First/Last functions on dates (`TopHitsAggExtractor`).

Fixes: #40152
matriv added a commit that referenced this issue Mar 20, 2019
When selecting columns of ES type `date` (SQL's DATETIME) the
`FieldHitExtractor` was not using the timezone of the client session
but always resorted to UTC. The same behaviour (UTC only) was
encountered also for grouping keys (`CompositeKeyExtractor`) and
for First/Last functions on dates (`TopHitsAggExtractor`).

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

Successfully merging a pull request may close this issue.

2 participants