From d5408b62951b1f2b2af3f47ec62a023e6669a2cb Mon Sep 17 00:00:00 2001 From: nikitamikhaylov Date: Thu, 24 Sep 2020 19:43:43 +0300 Subject: [PATCH] unique db to test --- .../01501_cache_dictionary_all_fields.sql | 93 ++++++++++--------- 1 file changed, 49 insertions(+), 44 deletions(-) diff --git a/tests/queries/0_stateless/01501_cache_dictionary_all_fields.sql b/tests/queries/0_stateless/01501_cache_dictionary_all_fields.sql index d9d8c79e33e..8bffaeacf4e 100644 --- a/tests/queries/0_stateless/01501_cache_dictionary_all_fields.sql +++ b/tests/queries/0_stateless/01501_cache_dictionary_all_fields.sql @@ -1,7 +1,11 @@ -drop table if exists table_cache_dict; -drop dictionary if exists cache_dict; +drop database if exists db_01501; +drop table if exists db_01501.table_cache_dict; +drop dictionary if exists db_01501.cache_dict; -CREATE TABLE table_cache_dict( + +create database db_01501; + +CREATE TABLE db_01501.table_cache_dict( KeyField UInt64, UInt8_ UInt8, UInt16_ UInt16, @@ -24,7 +28,7 @@ ParentKeyField UInt64) ENGINE = MergeTree() ORDER BY KeyField; -CREATE DICTIONARY IF NOT EXISTS cache_dict ( +CREATE DICTIONARY IF NOT EXISTS db_01501.cache_dict ( KeyField UInt64 DEFAULT 9999999, UInt8_ UInt8 DEFAULT 55, UInt16_ UInt16 DEFAULT 65535, @@ -45,71 +49,72 @@ CREATE DICTIONARY IF NOT EXISTS cache_dict ( Decimal128_ Decimal128(35) DEFAULT 555.11, ParentKeyField UInt64 DEFAULT 444) PRIMARY KEY KeyField -SOURCE(CLICKHOUSE(HOST 'localhost' PORT 9000 USER 'default' TABLE 'table_cache_dict' DB 'default')) +SOURCE(CLICKHOUSE(HOST 'localhost' PORT 9000 USER 'default' TABLE 'table_cache_dict' DB 'db_01501')) LIFETIME(5) LAYOUT(CACHE(SIZE_IN_CELLS 20)); -INSERT INTO table_cache_dict VALUES (1, 2, 3, 4, 5, -1, -2, -3, -4, '550e8400-e29b-41d4-a716-446655440003', '1973-06-28', '1985-02-28 23:43:25', 'clickhouse', 22.543, 3332154213.4, toDecimal32('1e-5', 5), toDecimal64('1e-15', 15), toDecimal128('1e-35', 35), 0); -INSERT INTO table_cache_dict VALUES (2, 22, 33, 44, 55, -11, -22, -33, -44, 'cb307805-44f0-49e7-9ae9-9954c543be46', '1978-06-28', '1986-02-28 23:42:25', 'hello', 21.543, 3111154213.9, toDecimal32('2e-5', 5), toDecimal64('2e-15', 15), toDecimal128('2e-35', 35), 1); -INSERT INTO table_cache_dict VALUES (3, 222, 333, 444, 555, -111, -222, -333, -444, 'de7f7ec3-f851-4f8c-afe5-c977cb8cea8d', '1982-06-28', '1999-02-28 23:42:25', 'dbms', 13.334, 3222187213.1, toDecimal32('3e-5', 5), toDecimal64('3e-15', 15), toDecimal128('3e-35', 35), 1); -INSERT INTO table_cache_dict VALUES (4, 2222, 3333, 4444, 5555, -1111, -2222, -3333, -4444, '4bd3829f-0669-43b7-b884-a8e034a68224', '1987-06-28', '2000-02-28 23:42:25', 'MergeTree', 52.001, 3237554213.5, toDecimal32('4e-5', 5), toDecimal64('4e-15', 15), toDecimal128('4e-35', 35), 1); -INSERT INTO table_cache_dict VALUES (5, 22222, 33333, 44444, 55555, -11111, -22222, -33333, -44444, 'ff99a408-78bb-4939-93cc-65e657e347c6', '1991-06-28', '2007-02-28 23:42:25', 'dictionary', 33.333, 3222193713.7, toDecimal32('5e-5', 5), toDecimal64('5e-15', 15), toDecimal128('5e-35', 35), 1); +INSERT INTO db_01501.table_cache_dict VALUES (1, 2, 3, 4, 5, -1, -2, -3, -4, '550e8400-e29b-41d4-a716-446655440003', '1973-06-28', '1985-02-28 23:43:25', 'clickhouse', 22.543, 3332154213.4, toDecimal32('1e-5', 5), toDecimal64('1e-15', 15), toDecimal128('1e-35', 35), 0); +INSERT INTO db_01501.table_cache_dict VALUES (2, 22, 33, 44, 55, -11, -22, -33, -44, 'cb307805-44f0-49e7-9ae9-9954c543be46', '1978-06-28', '1986-02-28 23:42:25', 'hello', 21.543, 3111154213.9, toDecimal32('2e-5', 5), toDecimal64('2e-15', 15), toDecimal128('2e-35', 35), 1); +INSERT INTO db_01501.table_cache_dict VALUES (3, 222, 333, 444, 555, -111, -222, -333, -444, 'de7f7ec3-f851-4f8c-afe5-c977cb8cea8d', '1982-06-28', '1999-02-28 23:42:25', 'dbms', 13.334, 3222187213.1, toDecimal32('3e-5', 5), toDecimal64('3e-15', 15), toDecimal128('3e-35', 35), 1); +INSERT INTO db_01501.table_cache_dict VALUES (4, 2222, 3333, 4444, 5555, -1111, -2222, -3333, -4444, '4bd3829f-0669-43b7-b884-a8e034a68224', '1987-06-28', '2000-02-28 23:42:25', 'MergeTree', 52.001, 3237554213.5, toDecimal32('4e-5', 5), toDecimal64('4e-15', 15), toDecimal128('4e-35', 35), 1); +INSERT INTO db_01501.table_cache_dict VALUES (5, 22222, 33333, 44444, 55555, -11111, -22222, -33333, -44444, 'ff99a408-78bb-4939-93cc-65e657e347c6', '1991-06-28', '2007-02-28 23:42:25', 'dictionary', 33.333, 3222193713.7, toDecimal32('5e-5', 5), toDecimal64('5e-15', 15), toDecimal128('5e-35', 35), 1); -SELECT arrayDistinct(groupArray(dictGetUInt8('default.cache_dict', 'UInt8_', toUInt64(number)))) from numbers(10); +SELECT arrayDistinct(groupArray(dictGetUInt8('db_01501.cache_dict', 'UInt8_', toUInt64(number)))) from numbers(10); system reload dictionaries; -SELECT arrayDistinct(groupArray(dictGetUInt16('default.cache_dict', 'UInt16_', toUInt64(number)))) from numbers(10); +SELECT arrayDistinct(groupArray(dictGetUInt16('db_01501.cache_dict', 'UInt16_', toUInt64(number)))) from numbers(10); system reload dictionaries; -SELECT arrayDistinct(groupArray(dictGetUInt32('default.cache_dict', 'UInt32_', toUInt64(number)))) from numbers(10); +SELECT arrayDistinct(groupArray(dictGetUInt32('db_01501.cache_dict', 'UInt32_', toUInt64(number)))) from numbers(10); system reload dictionaries; -SELECT arrayDistinct(groupArray(dictGetUInt64('default.cache_dict', 'UInt64_', toUInt64(number)))) from numbers(10); +SELECT arrayDistinct(groupArray(dictGetUInt64('db_01501.cache_dict', 'UInt64_', toUInt64(number)))) from numbers(10); system reload dictionaries; -SELECT arrayDistinct(groupArray(dictGetInt8('default.cache_dict', 'Int8_', toUInt64(number)))) from numbers(10); +SELECT arrayDistinct(groupArray(dictGetInt8('db_01501.cache_dict', 'Int8_', toUInt64(number)))) from numbers(10); system reload dictionaries; -SELECT arrayDistinct(groupArray(dictGetInt16('default.cache_dict', 'Int16_', toUInt64(number)))) from numbers(10); +SELECT arrayDistinct(groupArray(dictGetInt16('db_01501.cache_dict', 'Int16_', toUInt64(number)))) from numbers(10); system reload dictionaries; -SELECT arrayDistinct(groupArray(dictGetInt32('default.cache_dict', 'Int32_', toUInt64(number)))) from numbers(10); +SELECT arrayDistinct(groupArray(dictGetInt32('db_01501.cache_dict', 'Int32_', toUInt64(number)))) from numbers(10); system reload dictionaries; -SELECT arrayDistinct(groupArray(dictGetInt64('default.cache_dict', 'Int64_', toUInt64(number)))) from numbers(10); +SELECT arrayDistinct(groupArray(dictGetInt64('db_01501.cache_dict', 'Int64_', toUInt64(number)))) from numbers(10); system reload dictionaries; -SELECT arrayDistinct(groupArray(dictGetFloat32('default.cache_dict', 'Float32_', toUInt64(number)))) from numbers(10); +SELECT arrayDistinct(groupArray(dictGetFloat32('db_01501.cache_dict', 'Float32_', toUInt64(number)))) from numbers(10); system reload dictionaries; -SELECT arrayDistinct(groupArray(dictGetFloat64('default.cache_dict', 'Float64_', toUInt64(number)))) from numbers(10); +SELECT arrayDistinct(groupArray(dictGetFloat64('db_01501.cache_dict', 'Float64_', toUInt64(number)))) from numbers(10); system reload dictionaries; -SELECT arrayDistinct(groupArray(dictGet('default.cache_dict', 'Decimal32_', toUInt64(number)))) from numbers(10); +SELECT arrayDistinct(groupArray(dictGet('db_01501.cache_dict', 'Decimal32_', toUInt64(number)))) from numbers(10); system reload dictionaries; -SELECT arrayDistinct(groupArray(dictGet('default.cache_dict', 'Decimal64_', toUInt64(number)))) from numbers(10); +SELECT arrayDistinct(groupArray(dictGet('db_01501.cache_dict', 'Decimal64_', toUInt64(number)))) from numbers(10); system reload dictionaries; -SELECT arrayDistinct(groupArray(dictGet('default.cache_dict', 'Decimal128_', toUInt64(number)))) from numbers(10); +SELECT arrayDistinct(groupArray(dictGet('db_01501.cache_dict', 'Decimal128_', toUInt64(number)))) from numbers(10); system reload dictionaries; -SELECT arrayDistinct(groupArray(dictGetString('default.cache_dict', 'String_', toUInt64(number)))) from numbers(10); +SELECT arrayDistinct(groupArray(dictGetString('db_01501.cache_dict', 'String_', toUInt64(number)))) from numbers(10); -SELECT arrayDistinct(groupArray(dictGetUInt8('default.cache_dict', 'UInt8_', toUInt64(number)))) from numbers(10); -SELECT arrayDistinct(groupArray(dictGetUInt16('default.cache_dict', 'UInt16_', toUInt64(number)))) from numbers(10); -SELECT arrayDistinct(groupArray(dictGetUInt32('default.cache_dict', 'UInt32_', toUInt64(number)))) from numbers(10); -SELECT arrayDistinct(groupArray(dictGetUInt64('default.cache_dict', 'UInt64_', toUInt64(number)))) from numbers(10); -SELECT arrayDistinct(groupArray(dictGetInt8('default.cache_dict', 'Int8_', toUInt64(number)))) from numbers(10); -SELECT arrayDistinct(groupArray(dictGetInt16('default.cache_dict', 'Int16_', toUInt64(number)))) from numbers(10); -SELECT arrayDistinct(groupArray(dictGetInt32('default.cache_dict', 'Int32_', toUInt64(number)))) from numbers(10); -SELECT arrayDistinct(groupArray(dictGetInt64('default.cache_dict', 'Int64_', toUInt64(number)))) from numbers(10); -SELECT arrayDistinct(groupArray(dictGetFloat32('default.cache_dict', 'Float32_', toUInt64(number)))) from numbers(10); -SELECT arrayDistinct(groupArray(dictGetFloat64('default.cache_dict', 'Float64_', toUInt64(number)))) from numbers(10); -SELECT arrayDistinct(groupArray(dictGet('default.cache_dict', 'Decimal32_', toUInt64(number)))) from numbers(10); -SELECT arrayDistinct(groupArray(dictGet('default.cache_dict', 'Decimal64_', toUInt64(number)))) from numbers(10); -SELECT arrayDistinct(groupArray(dictGet('default.cache_dict', 'Decimal128_', toUInt64(number)))) from numbers(10); -SELECT arrayDistinct(groupArray(dictGetString('default.cache_dict', 'String_', toUInt64(number)))) from numbers(10); +SELECT arrayDistinct(groupArray(dictGetUInt8('db_01501.cache_dict', 'UInt8_', toUInt64(number)))) from numbers(10); +SELECT arrayDistinct(groupArray(dictGetUInt16('db_01501.cache_dict', 'UInt16_', toUInt64(number)))) from numbers(10); +SELECT arrayDistinct(groupArray(dictGetUInt32('db_01501.cache_dict', 'UInt32_', toUInt64(number)))) from numbers(10); +SELECT arrayDistinct(groupArray(dictGetUInt64('db_01501.cache_dict', 'UInt64_', toUInt64(number)))) from numbers(10); +SELECT arrayDistinct(groupArray(dictGetInt8('db_01501.cache_dict', 'Int8_', toUInt64(number)))) from numbers(10); +SELECT arrayDistinct(groupArray(dictGetInt16('db_01501.cache_dict', 'Int16_', toUInt64(number)))) from numbers(10); +SELECT arrayDistinct(groupArray(dictGetInt32('db_01501.cache_dict', 'Int32_', toUInt64(number)))) from numbers(10); +SELECT arrayDistinct(groupArray(dictGetInt64('db_01501.cache_dict', 'Int64_', toUInt64(number)))) from numbers(10); +SELECT arrayDistinct(groupArray(dictGetFloat32('db_01501.cache_dict', 'Float32_', toUInt64(number)))) from numbers(10); +SELECT arrayDistinct(groupArray(dictGetFloat64('db_01501.cache_dict', 'Float64_', toUInt64(number)))) from numbers(10); +SELECT arrayDistinct(groupArray(dictGet('db_01501.cache_dict', 'Decimal32_', toUInt64(number)))) from numbers(10); +SELECT arrayDistinct(groupArray(dictGet('db_01501.cache_dict', 'Decimal64_', toUInt64(number)))) from numbers(10); +SELECT arrayDistinct(groupArray(dictGet('db_01501.cache_dict', 'Decimal128_', toUInt64(number)))) from numbers(10); +SELECT arrayDistinct(groupArray(dictGetString('db_01501.cache_dict', 'String_', toUInt64(number)))) from numbers(10); system reload dictionaries; -SELECT groupArray(dictHas('default.cache_dict', toUInt64(number))) from numbers(10); -SELECT groupArray(dictHas('default.cache_dict', toUInt64(number))) from numbers(10); -SELECT groupArray(dictHas('default.cache_dict', toUInt64(number))) from numbers(10); -SELECT groupArray(dictHas('default.cache_dict', toUInt64(number))) from numbers(10); -SELECT groupArray(dictHas('default.cache_dict', toUInt64(number))) from numbers(10); +SELECT groupArray(dictHas('db_01501.cache_dict', toUInt64(number))) from numbers(10); +SELECT groupArray(dictHas('db_01501.cache_dict', toUInt64(number))) from numbers(10); +SELECT groupArray(dictHas('db_01501.cache_dict', toUInt64(number))) from numbers(10); +SELECT groupArray(dictHas('db_01501.cache_dict', toUInt64(number))) from numbers(10); +SELECT groupArray(dictHas('db_01501.cache_dict', toUInt64(number))) from numbers(10); drop table if exists table_cache_dict; -drop dictionary if exists cache_dict; \ No newline at end of file +drop dictionary if exists cache_dict; +drop database if exists db_01501; \ No newline at end of file