fix tests

This commit is contained in:
Nikita Vasilev 2020-05-09 14:48:33 +03:00
parent 270268f4a2
commit 74d5ed65c1
2 changed files with 48 additions and 9 deletions

View File

@ -0,0 +1,39 @@
TEST_SMALL
VALUE FROM RAM BUFFER
100
-100
clickhouse
100
-100
clickhouse
3
4
database
6
7
columns
9
8
UPDATE DICTIONARY
118
VALUE FROM DISK
-100
clickhouse
VALUE FROM RAM BUFFER
8
VALUES FROM DISK AND RAM BUFFER
118
HAS
6
VALUES NOT FROM TABLE
0 -1 none
0 -1 none
DUPLICATE KEYS
('1',3) -100
('2',-1) 4
('',0) -1
('',0) -1
('2',-1) 4
('1',3) -100

View File

@ -100,34 +100,34 @@ SELECT sum(dictGetUInt64('database_for_dict.ssd_dict', 'a', (k1, k2))) FROM data
SELECT 'VALUE FROM DISK'; SELECT 'VALUE FROM DISK';
-- -100 -- -100
SELECT dictGetInt32('database_for_dict.ssd_dict', 'b', ('1', 3)); SELECT dictGetInt32('database_for_dict.ssd_dict', 'b', ('1', toInt32(3)));
-- 'clickhouse' -- 'clickhouse'
SELECT dictGetString('database_for_dict.ssd_dict', 'c', ('1', 3)); SELECT dictGetString('database_for_dict.ssd_dict', 'c', ('1', toInt32(3)));
SELECT 'VALUE FROM RAM BUFFER'; SELECT 'VALUE FROM RAM BUFFER';
-- 8 -- 8
SELECT dictGetInt32('database_for_dict.ssd_dict', 'b', ('10', -20)); SELECT dictGetInt32('database_for_dict.ssd_dict', 'b', ('10', toInt32(-20)));
-- '' -- ''
SELECT dictGetString('database_for_dict.ssd_dict', 'c', ('10', -20)); SELECT dictGetString('database_for_dict.ssd_dict', 'c', ('10', toInt32(-20)));
SELECT 'VALUES FROM DISK AND RAM BUFFER'; SELECT 'VALUES FROM DISK AND RAM BUFFER';
-- 118 -- 118
SELECT sum(dictGetUInt64('database_for_dict.ssd_dict', 'a', (k1, k2))) FROM database_for_dict.keys_table; SELECT sum(dictGetUInt64('database_for_dict.ssd_dict', 'a', (k1, k2))) FROM database_for_dict.keys_table;
SELECT 'HAS'; SELECT 'HAS';
-- 1006 -- 6
SELECT count() FROM database_for_dict.keys_table WHERE dictHas('database_for_dict.ssd_dict', (k1, k2)); SELECT count() FROM database_for_dict.keys_table WHERE dictHas('database_for_dict.ssd_dict', (k1, k2));
SELECT 'VALUES NOT FROM TABLE'; SELECT 'VALUES NOT FROM TABLE';
-- 0 -1 none -- 0 -1 none
SELECT dictGetUInt64('database_for_dict.ssd_dict', 'a', ('unknown', 0)), dictGetInt32('database_for_dict.ssd_dict', 'b', ('unknown', 0)), dictGetString('database_for_dict.ssd_dict', 'c', ('unknown', 0)); SELECT dictGetUInt64('database_for_dict.ssd_dict', 'a', ('unknown', toInt32(0))), dictGetInt32('database_for_dict.ssd_dict', 'b', ('unknown', toInt32(0))), dictGetString('database_for_dict.ssd_dict', 'c', ('unknown', toInt32(0)));
SELECT dictGetUInt64('database_for_dict.ssd_dict', 'a', ('unknown', 0)), dictGetInt32('database_for_dict.ssd_dict', 'b', ('unknown', 0)), dictGetString('database_for_dict.ssd_dict', 'c', ('unknown', 0)); SELECT dictGetUInt64('database_for_dict.ssd_dict', 'a', ('unknown', toInt32(0))), dictGetInt32('database_for_dict.ssd_dict', 'b', ('unknown', toInt32(0))), dictGetString('database_for_dict.ssd_dict', 'c', ('unknown', toInt32(0)));
SELECT 'DUPLICATE KEYS'; SELECT 'DUPLICATE KEYS';
SELECT arrayJoin([('1', 3), ('2', -1), ('', 0), ('', 0), ('2', -1), ('1', 3)]) AS keys, dictGetInt32('database_for_dict.ssd_dict', 'b', toUInt64(keys)); SELECT arrayJoin([('1', toInt32(3)), ('2', toInt32(-1)), ('', toInt32(0)), ('', toInt32(0)), ('2', toInt32(-1)), ('1', toInt32(3))]) AS keys, dictGetInt32('database_for_dict.ssd_dict', 'b', keys);
--SELECT
DROP DICTIONARY IF EXISTS database_for_dict.ssd_dict; DROP DICTIONARY IF EXISTS database_for_dict.ssd_dict;
DROP TABLE IF EXISTS database_for_dict.keys_table; DROP TABLE IF EXISTS database_for_dict.keys_table;