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

Set X-ClickHouse-Timezone HTTP response header to the server's timezone #9493

Merged
merged 2 commits into from
Mar 4, 2020

Conversation

traceon
Copy link
Contributor

@traceon traceon commented Mar 3, 2020

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category:

  • New Feature;

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
From now on, HTTP responses will have X-ClickHouse-Timezone header set to the same timezone value that SELECT timezone() would report.

executeQuery() callbacks set_content_type_and_format and set_query_id were combined into one set_result_details callback that is expected to accept 4 string arguments: query id, content-type, format, and timezone.

Motivation: ODBC driver, when reading data in ODBCDriver2 format (strings), needs to know the Date's and DateTime's exact timezone, to be able to convert dates correctly. Similarly, when reading data in RowBinaryWithNamesAndTypes format (epoch-based integers), to be able to display Date and DateTime the same way as the clickhouse-client does by default, ODBC driver needs to convert epoch-based integers to server's timezone.

Set X-ClickHouse-Timezone HTTP Response header in the executeQuery() callback
@alexey-milovidov alexey-milovidov added pr-feature Pull request with new product feature doc-alert labels Mar 3, 2020
@alexey-milovidov alexey-milovidov merged commit 26c74d6 into ClickHouse:master Mar 4, 2020
@traceon traceon deleted the timezone-http-header branch March 4, 2020 17:14
@traceon traceon restored the timezone-http-header branch March 10, 2020 08:56
@traceon traceon deleted the timezone-http-header branch March 10, 2020 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature Pull request with new product feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants