ClickHouse/tests/queries/0_stateless/02235_remote_fs_cache_stress.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

74 lines
2.3 KiB
Bash
Raw Normal View History

2022-03-18 09:33:43 +00:00
#!/usr/bin/env bash
2022-03-29 17:11:36 +00:00
# Tags: no-fasttest, long, no-random-settings
2022-03-18 09:33:43 +00:00
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CUR_DIR"/../shell_config.sh
${CLICKHOUSE_CLIENT} --multiquery --multiline --query="""
DROP TABLE IF EXISTS t_01411;
DROP TABLE IF EXISTS t_01411_num;
2022-03-22 10:25:08 +00:00
drop table if exists lc_dict_reading;
2022-03-18 09:33:43 +00:00
CREATE TABLE t_01411(
str LowCardinality(String),
arr Array(LowCardinality(String)) default [str]
) ENGINE = MergeTree()
ORDER BY tuple();
2022-03-30 15:12:23 +00:00
INSERT INTO t_01411 (str) SELECT concat('asdf', toString(number % 10000)) FROM numbers(100000);
2022-03-18 09:33:43 +00:00
CREATE TABLE t_01411_num(
num UInt8,
arr Array(LowCardinality(Int64)) default [num]
) ENGINE = MergeTree()
ORDER BY tuple();
2022-03-30 15:12:23 +00:00
INSERT INTO t_01411_num (num) SELECT number % 1000 FROM numbers(100000);
2022-03-18 09:33:43 +00:00
2022-03-22 10:25:08 +00:00
create table lc_dict_reading (val UInt64, str StringWithDictionary, pat String) engine = MergeTree order by val;
2022-03-30 15:12:23 +00:00
insert into lc_dict_reading select number, if(number < 8192 * 4, number % 100, number) as s, s from system.numbers limit 100000;
2022-03-18 09:33:43 +00:00
"""
function go()
{
${CLICKHOUSE_CLIENT} --multiquery --multiline --query="""
2022-03-22 10:25:08 +00:00
select sum(toUInt64(str)), sum(toUInt64(pat)) from lc_dict_reading where val < 8129 or val > 8192 * 4;
2022-03-18 09:33:43 +00:00
SELECT count() FROM t_01411 WHERE str = 'asdf337';
SELECT count() FROM t_01411 WHERE arr[1] = 'asdf337';
SELECT count() FROM t_01411 WHERE has(arr, 'asdf337');
SELECT count() FROM t_01411 WHERE indexOf(arr, 'asdf337') > 0;
SELECT count() FROM t_01411 WHERE arr[1] = str;
SELECT count() FROM t_01411 WHERE has(arr, str);
SELECT count() FROM t_01411 WHERE indexOf(arr, str) > 0;
SELECT count() FROM t_01411_num WHERE num = 42;
SELECT count() FROM t_01411_num WHERE arr[1] = 42;
SELECT count() FROM t_01411_num WHERE has(arr, 42);
SELECT count() FROM t_01411_num WHERE indexOf(arr, 42) > 0;
SELECT count() FROM t_01411_num WHERE arr[1] = num;
SELECT count() FROM t_01411_num WHERE has(arr, num);
SELECT count() FROM t_01411_num WHERE indexOf(arr, num) > 0;
SELECT count() FROM t_01411_num WHERE indexOf(arr, num % 337) > 0;
SELECT indexOf(['a', 'b', 'c'], toLowCardinality('a'));
SELECT indexOf(['a', 'b', NULL], toLowCardinality('a'));
"""
}
2022-05-28 18:44:58 +00:00
for _ in `seq 1 32`; do go | grep -q "Exception" && echo 'FAIL' || echo 'OK' ||: & done
2022-03-18 09:33:43 +00:00
wait
${CLICKHOUSE_CLIENT} --multiquery --multiline --query="""
DROP TABLE IF EXISTS t_01411;
DROP TABLE IF EXISTS t_01411_num;
"""