exporter/clickhouse: backtick-quote cluster_name in ON CLUSTER clause#47835
Open
SAY-5 wants to merge 1 commit intoopen-telemetry:mainfrom
Open
exporter/clickhouse: backtick-quote cluster_name in ON CLUSTER clause#47835SAY-5 wants to merge 1 commit intoopen-telemetry:mainfrom
SAY-5 wants to merge 1 commit intoopen-telemetry:mainfrom
Conversation
clusterString emitted `ON CLUSTER <name>` without any quoting. A valid cluster_name that contains a dash (`ch-cluster` is the one the reporter hit), a space, or any non-alphanumeric identifier character caused ClickHouse to reject every schema-creation DDL with a syntax error and the pipeline failed to start: failed to start "clickhouse" exporter: create database: code: 62, message: Syntax error: failed at position 51 (-): -cluster Quote the identifier with backticks and double any embedded backticks (ClickHouse's quoted-identifier escape rule). Existing tests are updated to the quoted form plus two new cases covering `ch-cluster` and `weird``name`. Fixes open-telemetry#46946. Signed-off-by: SAY-5 <SAY-5@users.noreply.github.com> Assisted-by: Claude Opus 4.7
Contributor
|
Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib. Important reminders:
A maintainer will review your pull request soon. Thank you for helping make OpenTelemetry better! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
clusterStringemittedON CLUSTER <name>with no quoting. A validcluster_namecontaining a dash (ch-clusteris the one the reporter hit), a space, or any non-alphanumeric identifier character caused ClickHouse to reject every schema-creation DDL and the pipeline failed to start:Fix: backtick-quote the identifier, doubling any embedded backtick per ClickHouse's quoted-identifier escape rule. Existing tests updated to the quoted form plus two new cases covering
ch-clusterandweird+ backtick +name.Link to tracking issue: Fixes #46946
Testing:
go test ./exporter/clickhouseexporter/... -count=1passes.Documentation: Added
.chloggen/46946-clickhouse-cluster-quoting.yamlunderbug_fix.Signed-off-by: SAY-5 SAY-5@users.noreply.github.com
Assisted-by: Claude Opus 4.7