This commit is contained in:
Nikita Vasilev 2020-01-11 23:27:50 +03:00
parent a77ef1ed07
commit 590ed9759f
2 changed files with 11 additions and 2 deletions

View File

@ -6,6 +6,11 @@ VALUE FROM RAM BUFFER
8
VALUES FROM DISK AND RAM BUFFER
118
HAS
1
2
5
10
VALUES NOT FROM TABLE
0 -1
DUPLICATE KEYS

View File

@ -62,13 +62,17 @@ SELECT 'VALUES FROM DISK AND RAM BUFFER';
-- 118
SELECT sum(dictGetUInt64('database_for_dict.ssd_dict', 'a', toUInt64(id))) FROM database_for_dict.keys_table;
SELECT 'HAS';
-- 1 2 5 10
SELECT id FROM database_for_dict.keys_table WHERE dictHas('database_for_dict.ssd_dict', toUInt64(id)) ORDER BY id;
SELECT 'VALUES NOT FROM TABLE';
-- 0 -1
SELECT dictGetUInt64('database_for_dict.ssd_dict', 'a', toUInt64(1000000)), dictGetInt32('database_for_dict.ssd_dict', 'b', toUInt64(1000000));
SELECT 'DUPLICATE KEYS';
SELECT arrayJoin([1, 2, 3, 3, 2, 1]) AS id, dictGetInt32('database_for_dict.ssd_dict', 'b', toUInt64(id));
--SELECT
DROP DICTIONARY IF EXISTS database_for_dict.ssd_dict;
DROP TABLE IF EXISTS database_for_dict.keys_table;
@ -99,7 +103,7 @@ CREATE DICTIONARY database_for_dict.ssd_dict
PRIMARY KEY id
SOURCE(CLICKHOUSE(HOST 'localhost' PORT 9000 USER 'default' TABLE 'table_for_dict' PASSWORD '' DB 'database_for_dict'))
LIFETIME(MIN 1000 MAX 2000)
LAYOUT(SSD(MAX_PARTITION_SIZE 1000 PATH '/mnt/disk4/clickhouse_dicts/1'));
LAYOUT(SSD(MAX_PARTITION_SIZE 1000 PATH '/mnt/disk4/clickhouse_dicts/2'));
SELECT 'UPDATE DICTIONARY (MT)';
-- 118