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-Format HTTP response header to the format name #8769

Merged
merged 4 commits into from
Jan 23, 2020

Conversation

traceon
Copy link
Contributor

@traceon traceon commented Jan 21, 2020

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

Changelog category:

  • Non-significant (changelog entry is not required)

Detailed description / Documentation draft:

From now on, HTTP responses will have X-ClickHouse-Format header set to the format name of the returned data.

executeQuery() callback set_content_type is renamed to set_content_type_and_format that is expected to accept 2 string arguments: content-type (as before), and format (added).

Motivation: ODBC driver can only set the default format, and has now way of reliably determining the actual format of the response (which could be modified by in-SQL FORMAT keyword), thus unable to parse, or even detect an unsupported response data format in general case.

Copy link
Member

@alexey-milovidov alexey-milovidov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

Please mind that some formats have aliases. For example, TabSeparated = TSV.

@traceon
Copy link
Contributor Author

traceon commented Jan 21, 2020

Please mind that some formats have aliases. For example, TabSeparated = TSV.

@alexey-milovidov I thought it would make sense to always report the "canonical" name of the format, but it seemed to me that it would be too intrusive to expose all those getName()'s all the way to executeQuery(), so this change reports the format as it is passed in SQL or context.

@alexey-milovidov
Copy link
Member

Ok.

@traceon traceon changed the title WIP: Set X-ClickHouse-Format HTTP response header to the format name Set X-ClickHouse-Format HTTP response header to the format name Jan 21, 2020
@alexey-milovidov alexey-milovidov merged commit c698132 into ClickHouse:master Jan 23, 2020
@traceon traceon deleted the format-name-http-header branch January 24, 2020 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-not-for-changelog This PR should not be mentioned in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants