mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 17:12:03 +00:00
81 lines
3.3 KiB
XML
81 lines
3.3 KiB
XML
<test>
|
|
<create_query>
|
|
CREATE TABLE simple_direct_dictionary_test_table
|
|
(
|
|
id UInt64,
|
|
value_int UInt64,
|
|
value_string String,
|
|
value_decimal Decimal64(8),
|
|
value_string_nullable Nullable(String)
|
|
) ENGINE = TinyLog;
|
|
</create_query>
|
|
|
|
<create_query>
|
|
INSERT INTO simple_direct_dictionary_test_table
|
|
SELECT number, number, toString(number), toDecimal64(number, 8), toString(number)
|
|
FROM system.numbers
|
|
LIMIT 100000;
|
|
</create_query>
|
|
|
|
<create_query>
|
|
CREATE DICTIONARY simple_direct_dictionary
|
|
(
|
|
id UInt64,
|
|
value_int UInt64,
|
|
value_string String,
|
|
value_decimal Decimal64(8),
|
|
value_string_nullable Nullable(String)
|
|
)
|
|
PRIMARY KEY id
|
|
SOURCE(CLICKHOUSE(DB 'default' TABLE 'simple_direct_dictionary_test_table'))
|
|
LAYOUT(DIRECT())
|
|
</create_query>
|
|
|
|
<create_query>
|
|
CREATE TABLE complex_direct_dictionary_test_table
|
|
(
|
|
id UInt64,
|
|
id_key String,
|
|
value_int UInt64,
|
|
value_string String,
|
|
value_decimal Decimal64(8),
|
|
value_string_nullable Nullable(String)
|
|
) ENGINE = TinyLog;
|
|
</create_query>
|
|
|
|
<create_query>
|
|
INSERT INTO complex_direct_dictionary_test_table
|
|
SELECT number, toString(number), number, toString(number), toDecimal64(number, 8), toString(number)
|
|
FROM system.numbers
|
|
LIMIT 100000;
|
|
</create_query>
|
|
|
|
<create_query>
|
|
CREATE DICTIONARY complex_direct_dictionary
|
|
(
|
|
id UInt64,
|
|
id_key String,
|
|
value_int UInt64,
|
|
value_string String,
|
|
value_decimal Decimal64(8),
|
|
value_string_nullable Nullable(String)
|
|
)
|
|
PRIMARY KEY id, id_key
|
|
SOURCE(CLICKHOUSE(DB 'default' TABLE 'complex_direct_dictionary_test_table'))
|
|
LAYOUT(COMPLEX_KEY_DIRECT())
|
|
</create_query>
|
|
|
|
<query>SELECT dictGet('default.simple_direct_dictionary', 'value_int', number) FROM system.numbers LIMIT 150000;</query>
|
|
<query>SELECT dictGet('default.simple_direct_dictionary', 'value_string', number) FROM system.numbers LIMIT 150000;</query>
|
|
<query>SELECT dictGet('default.simple_direct_dictionary', 'value_decimal', number) FROM system.numbers LIMIT 150000;</query>
|
|
<query>SELECT dictGet('default.simple_direct_dictionary', 'value_string_nullable', number) FROM system.numbers LIMIT 150000;</query>
|
|
<query>SELECT dictHas('default.simple_direct_dictionary', number) FROM system.numbers LIMIT 150000;</query>
|
|
|
|
<query>SELECT dictGet('default.complex_direct_dictionary', 'value_int', (number, toString(number))) FROM system.numbers LIMIT 150000;</query>
|
|
<query>SELECT dictGet('default.complex_direct_dictionary', 'value_string', (number, toString(number))) FROM system.numbers LIMIT 150000;</query>
|
|
<query>SELECT dictGet('default.complex_direct_dictionary', 'value_decimal', (number, toString(number))) FROM system.numbers LIMIT 150000;</query>
|
|
<query>SELECT dictGet('default.complex_direct_dictionary', 'value_string_nullable', (number, toString(number))) FROM system.numbers LIMIT 150000;</query>
|
|
<query>SELECT dictHas('default.complex_direct_dictionary', (number, toString(number))) FROM system.numbers LIMIT 150000;</query>
|
|
|
|
</test>
|