Make 02950_dictionary_ssd_cache_short_circuit parallelizable

This commit is contained in:
Raúl Marín 2024-08-06 18:21:58 +02:00
parent 425fb0f485
commit 078e4ca36d

View File

@ -1,15 +1,11 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Tags: no-parallel
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh # shellcheck source=../shell_config.sh
. "$CURDIR"/../shell_config.sh . "$CURDIR"/../shell_config.sh
$CLICKHOUSE_CLIENT -n --query=" $CLICKHOUSE_CLIENT -n --query="
DROP DATABASE IF EXISTS 02950_database_for_ssd_cache_dictionary; CREATE TABLE source_table
CREATE DATABASE 02950_database_for_ssd_cache_dictionary;
CREATE TABLE 02950_database_for_ssd_cache_dictionary.source_table
( (
id UInt64, id UInt64,
v1 String, v1 String,
@ -18,9 +14,9 @@ $CLICKHOUSE_CLIENT -n --query="
) )
ENGINE = TinyLog; ENGINE = TinyLog;
INSERT INTO 02950_database_for_ssd_cache_dictionary.source_table VALUES (0, 'zero', 'zero', 0), (1, 'one', NULL, 1); INSERT INTO source_table VALUES (0, 'zero', 'zero', 0), (1, 'one', NULL, 1);
CREATE DICTIONARY 02950_database_for_ssd_cache_dictionary.ssd_cache_dictionary CREATE DICTIONARY ssd_cache_dictionary
( (
id UInt64, id UInt64,
v1 String, v1 String,
@ -30,12 +26,11 @@ $CLICKHOUSE_CLIENT -n --query="
PRIMARY KEY id PRIMARY KEY id
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'source_table')) SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'source_table'))
LIFETIME(MIN 1 MAX 1000) LIFETIME(MIN 1 MAX 1000)
LAYOUT(SSD_CACHE(BLOCK_SIZE 4096 FILE_SIZE 8192 PATH '$CLICKHOUSE_USER_FILES/0d')); LAYOUT(SSD_CACHE(BLOCK_SIZE 4096 FILE_SIZE 8192 PATH '$CLICKHOUSE_USER_FILES/${CLICKHOUSE_DATABASE}_ssd_dic'));
SELECT dictGetOrDefault('02950_database_for_ssd_cache_dictionary.ssd_cache_dictionary', ('v1', 'v2'), 0, (intDiv(1, id), intDiv(1, id))) FROM 02950_database_for_ssd_cache_dictionary.source_table; SELECT dictGetOrDefault('ssd_cache_dictionary', ('v1', 'v2'), 0, (intDiv(1, id), intDiv(1, id))) FROM source_table;
SELECT dictGetOrDefault('02950_database_for_ssd_cache_dictionary.ssd_cache_dictionary', 'v2', id+1, intDiv(NULL, id)) FROM 02950_database_for_ssd_cache_dictionary.source_table; SELECT dictGetOrDefault('ssd_cache_dictionary', 'v2', id+1, intDiv(NULL, id)) FROM source_table;
SELECT dictGetOrDefault('02950_database_for_ssd_cache_dictionary.ssd_cache_dictionary', 'v3', id+1, intDiv(NULL, id)) FROM 02950_database_for_ssd_cache_dictionary.source_table; SELECT dictGetOrDefault('ssd_cache_dictionary', 'v3', id+1, intDiv(NULL, id)) FROM source_table;
DROP DICTIONARY 02950_database_for_ssd_cache_dictionary.ssd_cache_dictionary; DROP DICTIONARY ssd_cache_dictionary;
DROP TABLE 02950_database_for_ssd_cache_dictionary.source_table; DROP TABLE source_table;"
DROP DATABASE 02950_database_for_ssd_cache_dictionary;"