Support writing generic LowCardinality(T) - #530
Conversation
Previously, clickhouse-cpp only supported writing LowCardinality(String). With this change, support is expanded to other fundamental types as well.
20beb75 to
e0d9d9f
Compare
|
I am a bit puzzled by this. Non-string Where and how do you use them? I’m wondering what the use case is here. |
|
@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. |
|
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. |
|
Just wondering, how you did you make |
Remove unsupported Enum and DateTime64 dictionary append paths, guard the fixed-size zero buffer against overflow, and drop the unused index visitor.
Cover String, FixedString, Int8-Int128, UInt8-UInt128, Float32/64, Date, Date32, DateTime, IPv4, IPv6 and UUID, each both as LowCardinality(T) and LowCardinality(Nullable(T)): fill a base column, append it to a generic ColumnLowCardinality, insert into the DB, select as ColumnLowCardinalityT<T> and verify the data matches row by row. Also add the ValueType alias to ColumnUUID, which is required to instantiate ColumnLowCardinalityT<ColumnUUID>.
Previously, clickhouse-cpp only supported writing LowCardinality(String).
With this change, support is expanded to other fundamental types as well.