Skip to content

feat(clickhouse sink): add extra_query_params for arbitrary ClickHouse settings - #25939

Open
valerypetrov wants to merge 6 commits into
vectordotdev:masterfrom
valerypetrov:feat/clickhouse-extra-query-params
Open

feat(clickhouse sink): add extra_query_params for arbitrary ClickHouse settings#25939
valerypetrov wants to merge 6 commits into
vectordotdev:masterfrom
valerypetrov:feat/clickhouse-extra-query-params

Conversation

@valerypetrov

Copy link
Copy Markdown

Summary

Adds an extra_query_params map to the ClickHouse sink that forwards arbitrary key-value pairs as URL query parameters on every INSERT request.

ClickHouse exposes hundreds of session settings via HTTP query parameters, but the sink previously only supported 6 hardcoded async insert settings. This change allows any ClickHouse setting to be passed without requiring server-side user profile changes.

Related issue: #25937

Example

[sinks.my_clickhouse.extra_query_params]
deduplicate_blocks_in_dependent_materialized_views = "0"
insert_quorum = "2"
max_insert_block_size = "1048576"

Changes

  • Added extra_query_params: HashMap<String, String> field to ClickhouseConfig
  • Threaded it through ClickhouseServiceRequestBuilder into set_uri_query
  • Extra params are percent-encoded via url::form_urlencoded::Serializer alongside the existing query/param_database/param_table params
  • Added unit test extra_query_params_are_appended verifying params appear in the URI

Testing

All 36 existing unit tests pass. New test covers the happy path.

Closes #25937

…e settings

Adds an `extra_query_params` map to the ClickHouse sink config that
forwards arbitrary key-value pairs as URL query parameters on every
INSERT request, enabling any ClickHouse session setting to be set
from Vector config without requiring server-side user profile changes.

Example use cases:
- deduplicate_blocks_in_dependent_materialized_views = 0
- insert_quorum = 2
- max_insert_block_size = 1048576

Closes vectordotdev#25937
@valerypetrov
valerypetrov requested a review from a team as a code owner July 23, 2026 20:51
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@github-actions github-actions Bot added the domain: sinks Anything related to the Vector's sinks label Jul 23, 2026
@datadog-vectordotdev

This comment has been minimized.

@valerypetrov

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@valerypetrov

Copy link
Copy Markdown
Author

recheck

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 51cba4db54

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/sinks/clickhouse/config.rs
Comment thread src/sinks/clickhouse/config.rs
@valerypetrov
valerypetrov requested a review from a team as a code owner July 23, 2026 21:08
@github-actions github-actions Bot added docs review on hold The documentation team reviews PRs only after a PR is approved by the COSE team. domain: external docs Anything related to Vector's external, public documentation labels Jul 23, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2b04426275

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/sinks/clickhouse/service.rs
Comment thread website/cue/reference/components/sinks/generated/clickhouse.cue Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4e942ed604

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread website/cue/reference/components/sinks/generated/clickhouse.cue Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs review on hold The documentation team reviews PRs only after a PR is approved by the COSE team. domain: external docs Anything related to Vector's external, public documentation domain: sinks Anything related to the Vector's sinks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ClickHouse sink: support arbitrary query-level settings via extra_query_params

1 participant