Clickhouse: Got "Sharding key expression does not evaluate to an integer type." when using siphash() to LowCardinality(String)

Created on 12 May 2020  路  1Comment  路  Source: ClickHouse/ClickHouse

This is about clickhouse sharding key in distributed table.
I have a replicatedmergetree table with field A with "LowCardinality(String)" type, and I use sipHash64(A) as sharding key in distributed table.
But when I set optimize_skip_unused_shards=true, got exception "Sharding key expression does not evaluate to an integer type." when I query distributed table with filter A=xxxx.

Does this mean sharding key can't apply to string field? I'm using 19.16.

st-fixed

Most helpful comment

So sipHash64(cast('foo', 'LowCardinality(String)'))returns LowCardinality(UInt64) and optimize_skip_unused_shards for LowCardinality has been fixed in #10611

>All comments

So sipHash64(cast('foo', 'LowCardinality(String)'))returns LowCardinality(UInt64) and optimize_skip_unused_shards for LowCardinality has been fixed in #10611

Was this page helpful?
0 / 5 - 0 ratings