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

Allow override session_id in exec #272

Merged

Conversation

Holi0317
Copy link
Contributor

Summary

Allow overriding session_id per query

#271

Checklist

Delete items not relevant to your PR:

  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided to include in CHANGELOG
  • For significant changes, documentation in https://github.com/ClickHouse/clickhouse-docs was updated with further explanations or tutorials

@slvrtrn
Copy link
Contributor

slvrtrn commented May 22, 2024

Thanks for your contribution! Nice catch.

A few notes:

  • the exec method is not intended to be used with CREATE TABLE statements; the relevant method is command. The main purpose of exec is to provide a workaround for "unusual" statements that will provide a useful output (select with a default format, select into a file) and something similar; if some of the docs/examples are misleading, let's update that as well.
  • that said, it is worth checking if we can do a similar override in the "main" three methods - query, command, insert; I am AFK now, so can't check it quickly.
  • If it is indeed the case that we cannot override the session id in these methods, let's add it there, too, and enhance the integration test to use all three methods (command to create a temp table, insert to insert the data, query to select). Maybe the same for exec.
  • Note: If you use exec to create the table, don't forget to destroy the returned stream. This is done internally in the command method (though the stream is not destroyed, but "drained" instead, to preserve the keep-alive socket).

@slvrtrn slvrtrn self-requested a review May 22, 2024 20:51
@slvrtrn slvrtrn self-assigned this May 22, 2024
@slvrtrn slvrtrn changed the base branch from main to override-session-id June 6, 2024 15:12
@slvrtrn slvrtrn merged commit c5d9dfe into ClickHouse:override-session-id Jun 6, 2024
9 of 12 checks passed
@slvrtrn
Copy link
Contributor

slvrtrn commented Jun 6, 2024

I will recreate it as a new PR from another branch (where I have write access).

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

Successfully merging this pull request may close these issues.

2 participants