Skip to content

Support writing generic LowCardinality(T)#530

Open
IyeOnline wants to merge 1 commit into
ClickHouse:masterfrom
IyeOnline:topic/expanded-low-cardinality-support
Open

Support writing generic LowCardinality(T)#530
IyeOnline wants to merge 1 commit into
ClickHouse:masterfrom
IyeOnline:topic/expanded-low-cardinality-support

Conversation

@IyeOnline

Copy link
Copy Markdown
Contributor

Previously, clickhouse-cpp only supported writing LowCardinality(String).
With this change, support is expanded to other fundamental types as well.

Previously, clickhouse-cpp only supported writing LowCardinality(String).
With this change, support is expanded to other fundamental types as well.
@IyeOnline IyeOnline force-pushed the topic/expanded-low-cardinality-support branch from 20beb75 to e0d9d9f Compare June 30, 2026 14:46
@IyeOnline IyeOnline marked this pull request as ready for review June 30, 2026 15:22
@IyeOnline IyeOnline requested review from mzitnik and slabko as code owners June 30, 2026 15:22
@slabko

slabko commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

@IyeOnline

I am a bit puzzled by this. Non-string LowCardinality types aren’t very popular, and in most cases, using plain numeric types is faster. They avoid unnecessary lookups at the cost of using a bit more storage, though not always even that. ClickHouse even disables them by default and requires enabling allow_suspicious_low_cardinality_types.

Where and how do you use them? I’m wondering what the use case is here.

@IyeOnline

Copy link
Copy Markdown
Contributor Author

@slabko There actually is no immediate use.

I was adding LowCardinality support to allow sending data to LowCardinality columns (they are strings in the concrete case) and noticed that it wouldnt work for non-string columns.

Since our sink is user-controlled, I would like to support this - even if its an evidently bad idea for most columns and most likely would be rejected by a default-configured ClickHouse server anyways.

@mavam

mavam commented Jul 1, 2026

Copy link
Copy Markdown

We have users that use these types, even though they might not be recommended or there are reasons why numeric types would be preferred. We currently cannot work with these Clickhouse deployments, and it's important to us that we can serve all users. These are effectively supported type and many people use them in prod.

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.

3 participants