dictionary_layout
flat
hashed
hashed_array
func
dictGetHierarchy
dictGetDescendants
CREATE TABLE hierarchical_dictionary_source_table
(
id UInt64,
parent_id UInt64
) ENGINE = Memory;
CREATE DICTIONARY hierarchical_{dictionary_layout}_dictionary
(
id UInt64,
parent_id UInt64 HIERARCHICAL
)
PRIMARY KEY id
SOURCE(CLICKHOUSE(DB 'default' TABLE 'hierarchical_dictionary_source_table'))
LAYOUT({dictionary_layout}())
LIFETIME(0);
INSERT INTO hierarchical_dictionary_source_table
SELECT number, rand64() % 250000
FROM system.numbers
LIMIT 500000;
SELECT {func}('hierarchical_{dictionary_layout}_dictionary', id) FROM hierarchical_{dictionary_layout}_dictionary FORMAT Null;
DROP TABLE IF EXISTS hierarchical_dictionary_source_table;
DROP DICTIONARY IF EXISTS hierarchical_{dictionary_layout}_dictionary;