mirror of
https://github.com/hanzoai/datastore.git
synced 2026-09-26 13:55:07 +00:00
75 lines
1.8 KiB
XML
75 lines
1.8 KiB
XML
<test>
|
|
<settings>
|
|
<max_threads>8</max_threads>
|
|
</settings>
|
|
|
|
<drop_query>
|
|
DROP DICTIONARY IF EXISTS dict_const_path;
|
|
</drop_query>
|
|
<drop_query>
|
|
DROP TABLE IF EXISTS dict_src_const_path;
|
|
</drop_query>
|
|
|
|
<create_query>
|
|
CREATE TABLE dict_src_const_path
|
|
(
|
|
id UInt64,
|
|
value UInt32,
|
|
value_str String
|
|
)
|
|
ENGINE = MergeTree
|
|
ORDER BY id;
|
|
</create_query>
|
|
|
|
<create_query>
|
|
INSERT INTO dict_src_const_path
|
|
SELECT
|
|
number AS id,
|
|
(number % 10000) AS value,
|
|
concat('value_', toString(number % 10000)) AS value_str
|
|
FROM numbers(10000000);
|
|
</create_query>
|
|
|
|
<create_query>
|
|
CREATE DICTIONARY dict_const_path
|
|
(
|
|
id UInt64,
|
|
value UInt32,
|
|
value_str String
|
|
)
|
|
PRIMARY KEY id
|
|
SOURCE(CLICKHOUSE(TABLE 'dict_src_const_path'))
|
|
LIFETIME(0)
|
|
LAYOUT(HASHED());
|
|
</create_query>
|
|
|
|
<query>
|
|
SELECT dictGetKeys('dict_const_path', 'value', 1) FORMAT NULL;
|
|
</query>
|
|
|
|
<query>
|
|
SELECT groupArray(id)
|
|
FROM dict_src_const_path
|
|
WHERE dictGetUInt32('dict_const_path', 'value', id) = 1
|
|
FORMAT NULL;
|
|
</query>
|
|
|
|
<query>
|
|
SELECT dictGetKeys('dict_const_path', 'value_str', 'value_1') FORMAT NULL;
|
|
</query>
|
|
|
|
<query>
|
|
SELECT groupArray(id)
|
|
FROM dict_src_const_path
|
|
WHERE dictGetString('dict_const_path', 'value_str', id) = 'value_1'
|
|
FORMAT NULL;
|
|
</query>
|
|
|
|
<drop_query>
|
|
DROP DICTIONARY IF EXISTS dict_const_path;
|
|
</drop_query>
|
|
<drop_query>
|
|
DROP TABLE IF EXISTS dict_src_const_path;
|
|
</drop_query>
|
|
</test>
|