Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Implementation per query settings #231

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

Merged
merged 2 commits into from
Oct 21, 2022
Merged

Implementation per query settings #231

merged 2 commits into from
Oct 21, 2022

Conversation

den818
Copy link
Contributor

@den818 den818 commented Oct 18, 2022

I would like to suggest the implementation of per-query settings. First of all, I refuse to support binary settings serialization because it is deprecated since server version 19.18. The implementation is based on the following ideas

  1. Use compiled checked settings names and values (especially for enums). It will protect from mistyping.
  2. Easy synchronization settings list with server source code. That's why settings, menus, and defaults are just copy-pasted from server sources. All macros have the same syntax.
  3. Settings have to be sent only if they have been set. No data is transmitted by default.
  4. Object QuerrySettings is light and easy to reuse in different queries. It contains unordered_map of string views of static names. So it allocate memory only for values.

Copy link
Contributor

@Enmk Enmk left a comment

Choose a reason for hiding this comment

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

Looks good except for some minor issues.

Please also consider adding tests with invalid setting key and/or values.

Erroring right away if user tries to send query settings to an old server.
@Enmk Enmk merged commit 07ab4e8 into ClickHouse:master Oct 21, 2022
@den818 den818 deleted the SETTINGS branch October 27, 2022 18:21
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