mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 01:22:04 +00:00
Merge pull request #65333 from iceFireser/master
add tests for 'boom filter index with map'
This commit is contained in:
commit
5d70cfaacc
@ -0,0 +1,4 @@
|
||||
{% for type in ['Int8', 'Int16', 'Int32', 'Int64', 'UInt8', 'UInt16', 'UInt32', 'UInt64'] -%}
|
||||
{'xxx':56}
|
||||
{56:'xxx'}
|
||||
{% endfor -%}
|
@ -0,0 +1,31 @@
|
||||
DROP TABLE IF EXISTS boom_filter_map_1;
|
||||
DROP TABLE IF EXISTS boom_filter_map_2;
|
||||
|
||||
{% for type in ['Int8', 'Int16', 'Int32', 'Int64', 'UInt8', 'UInt16', 'UInt32', 'UInt64'] -%}
|
||||
|
||||
CREATE TABLE boom_filter_map_1
|
||||
(
|
||||
`m` Map(String, {{ type }}),
|
||||
INDEX index_models_value_bloom_filter mapValues(m) TYPE bloom_filter GRANULARITY 1
|
||||
)
|
||||
ENGINE = MergeTree
|
||||
ORDER BY tuple();
|
||||
|
||||
CREATE TABLE boom_filter_map_2
|
||||
(
|
||||
`m` Map({{ type }}, String),
|
||||
INDEX index_models_value_bloom_filter mapKeys(m) TYPE bloom_filter GRANULARITY 1
|
||||
)
|
||||
ENGINE = MergeTree
|
||||
ORDER BY tuple();
|
||||
|
||||
INSERT INTO boom_filter_map_1 (m) values (map('xxx', 56));
|
||||
INSERT INTO boom_filter_map_2 (m) values (map(56, 'xxx'));
|
||||
|
||||
SELECT m FROM boom_filter_map_1 WHERE (m['xxx']) = 56;
|
||||
SELECT m FROM boom_filter_map_2 WHERE (m[56]) = 'xxx';
|
||||
|
||||
DROP TABLE IF EXISTS boom_filter_map_1;
|
||||
DROP TABLE IF EXISTS boom_filter_map_2;
|
||||
|
||||
{% endfor -%}
|
Loading…
Reference in New Issue
Block a user