1 个回答
使用map类型即可,例如创建表:
clickhouse对于map类型的包容性比较好,查询的时候可以直接使用data[‘key’]的方式查询,例如:
CREATE TABLE test.test_local2 on cluster default_cluster (
`id` UInt64,
`data` Map(String, String),
) ENGINE = ReplicatedMergeTree()
partition by dt
order by id;
CREATE TABLE test.test_all2 on cluster default_cluster as test.test_local2 ENGINE = Distributed('default_cluster', 'test', 'test_local2', sipHash64(id));
clickhouse对于map类型的包容性比较好,查询的时候可以直接使用data[‘key’]的方式查询,例如:
select data['key'] from test.test_all2 limit 5
发布于:1年前 (2024-03-19) IP属地:未知
我来回答
您需要 登录 后回答此问题!