From 74d5ed65c16963c1f5d17758b57b951971d2b3c4 Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Sat, 9 May 2020 14:48:33 +0300 Subject: [PATCH] fix tests --- ...01280_ssd_complex_key_dictionary.reference | 39 +++++++++++++++++++ .../01280_ssd_complex_key_dictionary.sql | 18 ++++----- 2 files changed, 48 insertions(+), 9 deletions(-) diff --git a/tests/queries/0_stateless/01280_ssd_complex_key_dictionary.reference b/tests/queries/0_stateless/01280_ssd_complex_key_dictionary.reference index e69de29bb2d..fa42fa7239e 100644 --- a/tests/queries/0_stateless/01280_ssd_complex_key_dictionary.reference +++ b/tests/queries/0_stateless/01280_ssd_complex_key_dictionary.reference @@ -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 diff --git a/tests/queries/0_stateless/01280_ssd_complex_key_dictionary.sql b/tests/queries/0_stateless/01280_ssd_complex_key_dictionary.sql index 2b9288d9257..0b7d73684aa 100644 --- a/tests/queries/0_stateless/01280_ssd_complex_key_dictionary.sql +++ b/tests/queries/0_stateless/01280_ssd_complex_key_dictionary.sql @@ -100,34 +100,34 @@ SELECT sum(dictGetUInt64('database_for_dict.ssd_dict', 'a', (k1, k2))) FROM data SELECT 'VALUE FROM DISK'; -- -100 -SELECT dictGetInt32('database_for_dict.ssd_dict', 'b', ('1', 3)); +SELECT dictGetInt32('database_for_dict.ssd_dict', 'b', ('1', toInt32(3))); -- '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'; -- 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'; -- 118 SELECT sum(dictGetUInt64('database_for_dict.ssd_dict', 'a', (k1, k2))) FROM database_for_dict.keys_table; SELECT 'HAS'; --- 1006 +-- 6 SELECT count() FROM database_for_dict.keys_table WHERE dictHas('database_for_dict.ssd_dict', (k1, k2)); SELECT 'VALUES NOT FROM TABLE'; -- 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', 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', 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 arrayJoin([('1', 3), ('2', -1), ('', 0), ('', 0), ('2', -1), ('1', 3)]) AS keys, dictGetInt32('database_for_dict.ssd_dict', 'b', toUInt64(keys)); ---SELECT +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); + DROP DICTIONARY IF EXISTS database_for_dict.ssd_dict; DROP TABLE IF EXISTS database_for_dict.keys_table;