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

Any way to get a correct X-ClickHouse-Summary without send_progress_in_http_headers? #12122

Closed
iameugenejo opened this issue Jul 3, 2020 · 3 comments
Labels
comp-http http protocol related question Question?

Comments

@iameugenejo
Copy link

iameugenejo commented Jul 3, 2020

I have an application sending a big query to clickhouse using http interface, and I need to get the summary of the query at the end. (I cannot use JSON format for it)

The X-ClickHouse-Summary header from the request has all the fields set to 0, which is incorrect -

 X-ClickHouse-Summary: {"read_rows":"0","read_bytes":"0","written_rows":"0","written_bytes":"0","total_rows_to_read":"0"}

Only way I get the correct summary is to pass send_progress_in_http_headers=1

The problem is, http client modules I have tried throw an error for having too many headers in the response.

python requests -
requests.exceptions.ConnectionError: ('Connection aborted.', HTTPException('got more than 100 headers',))
nodejs requests -
{ [Error: Parse Error] bytesParsed: 153, code: 'HPE_HEADER_OVERFLOW'}

Is there any way to get the correct summary output without the progress headers?

@iameugenejo iameugenejo added the question Question? label Jul 3, 2020
@iameugenejo iameugenejo changed the title Anyway to get a correct X-ClickHouse-Summary without send_progress_in_http_headers? Any way to get a correct X-ClickHouse-Summary without send_progress_in_http_headers? Jul 3, 2020
@iameugenejo
Copy link
Author

iameugenejo commented Jul 3, 2020

I just found a workaround, adding a huge http_headers_progress_interval_ms value to suppress the progress header for a long time seems to work for my case. http_headers_progress_interval_ms=3600000.

I would still like to know if there's a better or a correct way to do this.

@filimonov filimonov added the comp-http http protocol related label Jul 6, 2020
@alexey-milovidov
Copy link
Member

The way you have found is Ok: you want to get only one X-ClickHouse-Summary header at the end of query execution (if no data was sent at this moment), so you set progress interval to very large value. Looks appropriate.

I don't know any better way to do it.

@alexey-milovidov
Copy link
Member

If data is sent too early, you can also provide wait_end_of_query=1 parameter in URL that will buffer all the data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-http http protocol related question Question?
Projects
None yet
Development

No branches or pull requests

3 participants