Support for struct field mapping to columns with dot (.) notation in ClickHouse Go client #1619
Closed
senabd
started this conversation in
Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The Go ClickHouse client’s
AppendStruct
currently does not support mapping Go struct fields to ClickHouse columns that contain dot (.
) characters in their names, such as:When attempting to map these columns using Go struct tags:
And inserting data like:
Calling
AppendStruct
results in an error such as:Why is this needed?
This limitation makes it difficult to work with flattened Avro or Parquet schemas that use dot notation to represent nested structures—especially when column names are fixed and cannot be changed due to schema compatibility, ingestion contracts, or external dependencies.
Proposed solution
Enable the Go client’s
AppendStruct
method to:ch:"Nested.FieldName"
and match them with column names containing dot notation.clickhouse:""
) to explicitly map Go fields to arbitrary column names including those with dots.Workarounds attempted
AppendStruct
.Environment
v2.37.2
(latest as of writing)24.3.2.23
PrepareBatch
+AppendStruct
patternAdditional context
Support for this feature would help teams working with structured data (e.g., Avro, Protobuf, etc.) seamlessly ingest telemetry or event-based data into ClickHouse without restructuring their pipelines or schemas.
Beta Was this translation helpful? Give feedback.
All reactions