mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
Stateless tests: run sequential tests in parallel to other tests
This commit is contained in:
parent
249c80a26d
commit
88d92367b7
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: long, shard, no-parallel
|
||||
# Tags: long, shard
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: long, no-parallel
|
||||
# Tags: long
|
||||
|
||||
set -e
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: no-parallel
|
||||
|
||||
CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL=none
|
||||
|
||||
@ -7,9 +6,10 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
${CLICKHOUSE_CLIENT} -q "drop user if exists u_00600"
|
||||
${CLICKHOUSE_CLIENT} -q "create user u_00600 settings max_execution_time=60, readonly=1"
|
||||
${CLICKHOUSE_CLIENT} -q "grant select on system.numbers to u_00600"
|
||||
TEST_PREFIX=$RANDOM
|
||||
${CLICKHOUSE_CLIENT} -q "drop user if exists u_00600${TEST_PREFIX}"
|
||||
${CLICKHOUSE_CLIENT} -q "create user u_00600${TEST_PREFIX} settings max_execution_time=60, readonly=1"
|
||||
${CLICKHOUSE_CLIENT} -q "grant select on system.numbers to u_00600${TEST_PREFIX}"
|
||||
|
||||
function wait_for_query_to_start()
|
||||
{
|
||||
@ -26,7 +26,7 @@ $CLICKHOUSE_CURL -sS "$CLICKHOUSE_URL&query_id=hello&replace_running_query=1" -d
|
||||
# Wait for it to be replaced
|
||||
wait
|
||||
|
||||
${CLICKHOUSE_CLIENT_BINARY} --user=u_00600 --query_id=42 --query='SELECT 2, count() FROM system.numbers' 2>&1 | grep -cF 'was cancelled' &
|
||||
${CLICKHOUSE_CLIENT_BINARY} --user=u_00600${TEST_PREFIX} --query_id=42 --query='SELECT 2, count() FROM system.numbers' 2>&1 | grep -cF 'was cancelled' &
|
||||
wait_for_query_to_start '42'
|
||||
|
||||
# Trying to run another query with the same query_id
|
||||
@ -43,4 +43,4 @@ wait_for_query_to_start '42'
|
||||
${CLICKHOUSE_CLIENT} --query_id=42 --replace_running_query=1 --replace_running_query_max_wait_ms=500 --query='SELECT 43' 2>&1 | grep -F "can't be stopped" > /dev/null
|
||||
wait
|
||||
${CLICKHOUSE_CLIENT} --query_id=42 --replace_running_query=1 --query='SELECT 44'
|
||||
${CLICKHOUSE_CLIENT} -q "drop user u_00600"
|
||||
${CLICKHOUSE_CLIENT} -q "drop user u_00600${TEST_PREFIX}"
|
||||
|
@ -1,50 +1,43 @@
|
||||
-- Tags: no-parallel
|
||||
|
||||
DROP DATABASE IF EXISTS truncate_test;
|
||||
|
||||
CREATE DATABASE IF NOT EXISTS truncate_test;
|
||||
CREATE TABLE IF NOT EXISTS truncate_test.truncate_test_set(id UInt64) ENGINE = Set;
|
||||
CREATE TABLE IF NOT EXISTS truncate_test.truncate_test_log(id UInt64) ENGINE = Log;
|
||||
CREATE TABLE IF NOT EXISTS truncate_test.truncate_test_memory(id UInt64) ENGINE = Memory;
|
||||
CREATE TABLE IF NOT EXISTS truncate_test.truncate_test_tiny_log(id UInt64) ENGINE = TinyLog;
|
||||
CREATE TABLE IF NOT EXISTS truncate_test.truncate_test_stripe_log(id UInt64) ENGINE = StripeLog;
|
||||
CREATE TABLE IF NOT EXISTS truncate_test.truncate_test_merge_tree(p Date, k UInt64) ENGINE = MergeTree ORDER BY p;
|
||||
CREATE TABLE IF NOT EXISTS truncate_test_set(id UInt64) ENGINE = Set;
|
||||
CREATE TABLE IF NOT EXISTS truncate_test_log(id UInt64) ENGINE = Log;
|
||||
CREATE TABLE IF NOT EXISTS truncate_test_memory(id UInt64) ENGINE = Memory;
|
||||
CREATE TABLE IF NOT EXISTS truncate_test_tiny_log(id UInt64) ENGINE = TinyLog;
|
||||
CREATE TABLE IF NOT EXISTS truncate_test_stripe_log(id UInt64) ENGINE = StripeLog;
|
||||
CREATE TABLE IF NOT EXISTS truncate_test_merge_tree(p Date, k UInt64) ENGINE = MergeTree ORDER BY p;
|
||||
|
||||
SELECT '======Before Truncate======';
|
||||
INSERT INTO truncate_test.truncate_test_set VALUES(0);
|
||||
INSERT INTO truncate_test.truncate_test_log VALUES(1);
|
||||
INSERT INTO truncate_test.truncate_test_memory VALUES(1);
|
||||
INSERT INTO truncate_test.truncate_test_tiny_log VALUES(1);
|
||||
INSERT INTO truncate_test.truncate_test_stripe_log VALUES(1);
|
||||
INSERT INTO truncate_test.truncate_test_merge_tree VALUES('2000-01-01', 1);
|
||||
SELECT * FROM system.numbers WHERE number NOT IN truncate_test.truncate_test_set LIMIT 1;
|
||||
SELECT * FROM truncate_test.truncate_test_log;
|
||||
SELECT * FROM truncate_test.truncate_test_memory;
|
||||
SELECT * FROM truncate_test.truncate_test_tiny_log;
|
||||
SELECT * FROM truncate_test.truncate_test_stripe_log;
|
||||
SELECT * FROM truncate_test.truncate_test_merge_tree;
|
||||
INSERT INTO truncate_test_set VALUES(0);
|
||||
INSERT INTO truncate_test_log VALUES(1);
|
||||
INSERT INTO truncate_test_memory VALUES(1);
|
||||
INSERT INTO truncate_test_tiny_log VALUES(1);
|
||||
INSERT INTO truncate_test_stripe_log VALUES(1);
|
||||
INSERT INTO truncate_test_merge_tree VALUES('2000-01-01', 1);
|
||||
SELECT * FROM system.numbers WHERE number NOT IN truncate_test_set LIMIT 1;
|
||||
SELECT * FROM truncate_test_log;
|
||||
SELECT * FROM truncate_test_memory;
|
||||
SELECT * FROM truncate_test_tiny_log;
|
||||
SELECT * FROM truncate_test_stripe_log;
|
||||
SELECT * FROM truncate_test_merge_tree;
|
||||
|
||||
SELECT '======After Truncate And Empty======';
|
||||
TRUNCATE ALL TABLES FROM IF EXISTS truncate_test;
|
||||
SELECT * FROM system.numbers WHERE number NOT IN truncate_test.truncate_test_set LIMIT 1;
|
||||
SELECT * FROM truncate_test.truncate_test_log;
|
||||
SELECT * FROM truncate_test.truncate_test_memory;
|
||||
SELECT * FROM truncate_test.truncate_test_tiny_log;
|
||||
SELECT * FROM truncate_test.truncate_test_stripe_log;
|
||||
SELECT * FROM truncate_test.truncate_test_merge_tree;
|
||||
TRUNCATE ALL TABLES FROM IF EXISTS {CLICKHOUSE_DATABASE:Identifier};
|
||||
SELECT * FROM system.numbers WHERE number NOT IN truncate_test_set LIMIT 1;
|
||||
SELECT * FROM truncate_test_log;
|
||||
SELECT * FROM truncate_test_memory;
|
||||
SELECT * FROM truncate_test_tiny_log;
|
||||
SELECT * FROM truncate_test_stripe_log;
|
||||
SELECT * FROM truncate_test_merge_tree;
|
||||
|
||||
SELECT '======After Truncate And Insert Data======';
|
||||
INSERT INTO truncate_test.truncate_test_set VALUES(0);
|
||||
INSERT INTO truncate_test.truncate_test_log VALUES(1);
|
||||
INSERT INTO truncate_test.truncate_test_memory VALUES(1);
|
||||
INSERT INTO truncate_test.truncate_test_tiny_log VALUES(1);
|
||||
INSERT INTO truncate_test.truncate_test_stripe_log VALUES(1);
|
||||
INSERT INTO truncate_test.truncate_test_merge_tree VALUES('2000-01-01', 1);
|
||||
SELECT * FROM system.numbers WHERE number NOT IN truncate_test.truncate_test_set LIMIT 1;
|
||||
SELECT * FROM truncate_test.truncate_test_log;
|
||||
SELECT * FROM truncate_test.truncate_test_memory;
|
||||
SELECT * FROM truncate_test.truncate_test_tiny_log;
|
||||
SELECT * FROM truncate_test.truncate_test_stripe_log;
|
||||
SELECT * FROM truncate_test.truncate_test_merge_tree;
|
||||
|
||||
DROP DATABASE IF EXISTS truncate_test;
|
||||
INSERT INTO truncate_test_set VALUES(0);
|
||||
INSERT INTO truncate_test_log VALUES(1);
|
||||
INSERT INTO truncate_test_memory VALUES(1);
|
||||
INSERT INTO truncate_test_tiny_log VALUES(1);
|
||||
INSERT INTO truncate_test_stripe_log VALUES(1);
|
||||
INSERT INTO truncate_test_merge_tree VALUES('2000-01-01', 1);
|
||||
SELECT * FROM system.numbers WHERE number NOT IN truncate_test_set LIMIT 1;
|
||||
SELECT * FROM truncate_test_log;
|
||||
SELECT * FROM truncate_test_memory;
|
||||
SELECT * FROM truncate_test_tiny_log;
|
||||
SELECT * FROM truncate_test_stripe_log;
|
||||
SELECT * FROM truncate_test_merge_tree;
|
||||
|
@ -1,6 +1,5 @@
|
||||
set allow_deprecated_syntax_for_merge_tree=1;
|
||||
|
||||
DROP DATABASE IF EXISTS truncate_test;
|
||||
DROP TABLE IF EXISTS truncate_test_log;
|
||||
DROP TABLE IF EXISTS truncate_test_memory;
|
||||
DROP TABLE IF EXISTS truncate_test_tiny_log;
|
||||
@ -9,7 +8,6 @@ DROP TABLE IF EXISTS truncate_test_merge_tree;
|
||||
DROP TABLE IF EXISTS truncate_test_materialized_view;
|
||||
DROP TABLE IF EXISTS truncate_test_materialized_depend;
|
||||
|
||||
CREATE DATABASE truncate_test;
|
||||
CREATE TABLE truncate_test_set(id UInt64) ENGINE = Set;
|
||||
CREATE TABLE truncate_test_log(id UInt64) ENGINE = Log;
|
||||
CREATE TABLE truncate_test_memory(id UInt64) ENGINE = Memory;
|
||||
@ -75,4 +73,3 @@ DROP TABLE IF EXISTS truncate_test_stripe_log;
|
||||
DROP TABLE IF EXISTS truncate_test_merge_tree;
|
||||
DROP TABLE IF EXISTS truncate_test_materialized_view;
|
||||
DROP TABLE IF EXISTS truncate_test_materialized_depend;
|
||||
DROP DATABASE IF EXISTS truncate_test;
|
||||
|
@ -1,13 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: no-parallel
|
||||
|
||||
set -e
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "DROP DATABASE IF EXISTS parallel_ddl"
|
||||
DB_SUFFIX=$RANDOM
|
||||
${CLICKHOUSE_CLIENT} --query "DROP DATABASE IF EXISTS parallel_ddl_${DB_SUFFIX}"
|
||||
|
||||
function query()
|
||||
{
|
||||
@ -16,8 +15,8 @@ function query()
|
||||
while [ $SECONDS -lt "$TIMELIMIT" ] && [ $it -lt 50 ];
|
||||
do
|
||||
it=$((it+1))
|
||||
${CLICKHOUSE_CLIENT} --query "CREATE DATABASE IF NOT EXISTS parallel_ddl"
|
||||
${CLICKHOUSE_CLIENT} --query "DROP DATABASE IF EXISTS parallel_ddl"
|
||||
${CLICKHOUSE_CLIENT} --query "CREATE DATABASE IF NOT EXISTS parallel_ddl_${DB_SUFFIX}"
|
||||
${CLICKHOUSE_CLIENT} --query "DROP DATABASE IF EXISTS parallel_ddl_${DB_SUFFIX}"
|
||||
done
|
||||
}
|
||||
|
||||
@ -27,4 +26,4 @@ done
|
||||
|
||||
wait
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "DROP DATABASE IF EXISTS parallel_ddl"
|
||||
${CLICKHOUSE_CLIENT} --query "DROP DATABASE IF EXISTS parallel_ddl_${DB_SUFFIX}"
|
||||
|
@ -21,7 +21,7 @@ function thread1()
|
||||
|
||||
function thread2()
|
||||
{
|
||||
seq 1 1000 | sed -r -e 's/.+/SELECT count() FROM buffer_00763_2;/' | ${CLICKHOUSE_CLIENT} --multiquery --server_logs_file='/dev/null' --ignore-error 2>&1 | grep -vP '^0$|^10$|^Received exception|^Code: 60|^Code: 218|^Code: 473' | grep -v '(query: '
|
||||
seq 1 500 | sed -r -e 's/.+/SELECT count() FROM buffer_00763_2;/' | ${CLICKHOUSE_CLIENT} --multiquery --server_logs_file='/dev/null' --ignore-error 2>&1 | grep -vP '^0$|^10$|^Received exception|^Code: 60|^Code: 218|^Code: 473' | grep -v '(query: '
|
||||
}
|
||||
|
||||
thread1 &
|
||||
|
@ -50,7 +50,7 @@ export -f thread2;
|
||||
export -f thread3;
|
||||
export -f thread4;
|
||||
|
||||
TIMEOUT=30
|
||||
TIMEOUT=20
|
||||
|
||||
timeout $TIMEOUT bash -c thread1 2> /dev/null &
|
||||
timeout $TIMEOUT bash -c thread2 2> /dev/null &
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: deadlock, no-parallel, no-debug
|
||||
# Tags: deadlock, no-debug
|
||||
|
||||
# NOTE: database = $CLICKHOUSE_DATABASE is unwanted
|
||||
|
||||
@ -49,7 +49,7 @@ function thread_select()
|
||||
export -f thread_drop_create
|
||||
export -f thread_select
|
||||
|
||||
TIMEOUT=60
|
||||
TIMEOUT=30
|
||||
thread_drop_create $TIMEOUT &
|
||||
thread_select $TIMEOUT &
|
||||
|
||||
|
@ -1,9 +1,4 @@
|
||||
-- Tags: no-parallel
|
||||
|
||||
DROP DATABASE IF EXISTS test_buffer;
|
||||
CREATE DATABASE test_buffer;
|
||||
CREATE TABLE test_buffer.mt (uid UInt64, ts DateTime, val Float64) ENGINE = MergeTree PARTITION BY toDate(ts) ORDER BY (uid, ts);
|
||||
CREATE TABLE test_buffer.buf as test_buffer.mt ENGINE = Buffer(test_buffer, mt, 2, 10, 60, 10000, 100000, 1000000, 10000000);
|
||||
INSERT INTO test_buffer.buf VALUES (1, '2019-03-01 10:00:00', 0.5), (2, '2019-03-02 10:00:00', 0.15), (1, '2019-03-03 10:00:00', 0.25);
|
||||
SELECT count() from test_buffer.buf prewhere ts > toDateTime('2019-03-01 12:00:00') and ts < toDateTime('2019-03-02 12:00:00');
|
||||
DROP DATABASE test_buffer;
|
||||
CREATE TABLE mt (uid UInt64, ts DateTime, val Float64) ENGINE = MergeTree PARTITION BY toDate(ts) ORDER BY (uid, ts);
|
||||
CREATE TABLE buf as mt ENGINE = Buffer({CLICKHOUSE_DATABASE:Identifier}, mt, 2, 10, 60, 10000, 100000, 1000000, 10000000);
|
||||
INSERT INTO buf VALUES (1, '2019-03-01 10:00:00', 0.5), (2, '2019-03-02 10:00:00', 0.15), (1, '2019-03-03 10:00:00', 0.25);
|
||||
SELECT count() from buf prewhere ts > toDateTime('2019-03-01 12:00:00') and ts < toDateTime('2019-03-02 12:00:00');
|
||||
|
@ -1,12 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: no-parallel
|
||||
|
||||
# shellcheck disable=SC2016,SC2028
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
CURDIR=$CURDIR/${CLICKHOUSE_DATABASE}
|
||||
mkdir -p $CURDIR
|
||||
|
||||
$CLICKHOUSE_CLIENT --query="DROP TABLE IF EXISTS template1";
|
||||
$CLICKHOUSE_CLIENT --query="DROP TABLE IF EXISTS template2";
|
||||
$CLICKHOUSE_CLIENT --query="CREATE TABLE template1 (s1 String, s2 String, s3 String, s4 String, n UInt64, d Date) ENGINE = Memory";
|
||||
|
@ -1,5 +1,3 @@
|
||||
-- Tags: no-parallel
|
||||
|
||||
DROP TABLE IF EXISTS mt;
|
||||
|
||||
CREATE TABLE mt (x UInt64) ENGINE = MergeTree ORDER BY x SETTINGS parts_to_delay_insert = 100000, parts_to_throw_insert = 100000;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: no-parallel, no-fasttest
|
||||
# Tags: no-fasttest
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
@ -89,7 +89,7 @@ ${CLICKHOUSE_CLIENT} -n -q "
|
||||
"
|
||||
|
||||
|
||||
TIMEOUT=30
|
||||
TIMEOUT=20
|
||||
|
||||
timeout $TIMEOUT bash -c recreate_lazy_func1 2> /dev/null &
|
||||
timeout $TIMEOUT bash -c recreate_lazy_func2 2> /dev/null &
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: zookeeper, no-parallel, no-fasttest
|
||||
# Tags: zookeeper, no-fasttest
|
||||
|
||||
set -e
|
||||
|
||||
@ -61,7 +61,7 @@ export -f thread3;
|
||||
export -f thread4;
|
||||
export -f thread5;
|
||||
|
||||
TIMEOUT=30
|
||||
TIMEOUT=20
|
||||
|
||||
timeout $TIMEOUT bash -c thread1 2> /dev/null &
|
||||
timeout $TIMEOUT bash -c thread2 2> /dev/null &
|
||||
|
@ -1,35 +1,25 @@
|
||||
-- Tags: no-parallel
|
||||
|
||||
DROP DATABASE IF EXISTS dict_db_01036;
|
||||
CREATE DATABASE dict_db_01036;
|
||||
|
||||
CREATE TABLE dict_db_01036.dict_data (key UInt64, val UInt64) Engine=Memory();
|
||||
CREATE DICTIONARY dict_db_01036.dict
|
||||
CREATE TABLE dict_data (key UInt64, val UInt64) Engine=Memory();
|
||||
CREATE DICTIONARY dict
|
||||
(
|
||||
key UInt64 DEFAULT 0,
|
||||
val UInt64 DEFAULT 10
|
||||
)
|
||||
PRIMARY KEY key
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'dict_data' PASSWORD '' DB 'dict_db_01036'))
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'dict_data' PASSWORD '' DB currentDatabase()))
|
||||
LIFETIME(MIN 0 MAX 0)
|
||||
LAYOUT(FLAT());
|
||||
|
||||
SELECT query_count FROM system.dictionaries WHERE database = 'dict_db_01036' AND name = 'dict';
|
||||
SELECT dictGetUInt64('dict_db_01036.dict', 'val', toUInt64(0));
|
||||
SELECT query_count FROM system.dictionaries WHERE database = 'dict_db_01036' AND name = 'dict';
|
||||
SELECT query_count FROM system.dictionaries WHERE database = currentDatabase() AND name = 'dict';
|
||||
SELECT dictGetUInt64('dict', 'val', toUInt64(0));
|
||||
SELECT query_count FROM system.dictionaries WHERE database = currentDatabase() AND name = 'dict';
|
||||
|
||||
SELECT 'SYSTEM RELOAD DICTIONARY';
|
||||
SYSTEM RELOAD DICTIONARY dict_db_01036.dict;
|
||||
SELECT query_count FROM system.dictionaries WHERE database = 'dict_db_01036' AND name = 'dict';
|
||||
SELECT dictGetUInt64('dict_db_01036.dict', 'val', toUInt64(0));
|
||||
SELECT query_count FROM system.dictionaries WHERE database = 'dict_db_01036' AND name = 'dict';
|
||||
SYSTEM RELOAD DICTIONARY dict;
|
||||
SELECT query_count FROM system.dictionaries WHERE database = currentDatabase() AND name = 'dict';
|
||||
SELECT dictGetUInt64('dict', 'val', toUInt64(0));
|
||||
SELECT query_count FROM system.dictionaries WHERE database = currentDatabase() AND name = 'dict';
|
||||
|
||||
SELECT 'CREATE DATABASE';
|
||||
DROP DATABASE IF EXISTS empty_db_01036;
|
||||
CREATE DATABASE empty_db_01036;
|
||||
SELECT query_count FROM system.dictionaries WHERE database = 'dict_db_01036' AND name = 'dict';
|
||||
|
||||
DROP DICTIONARY dict_db_01036.dict;
|
||||
DROP TABLE dict_db_01036.dict_data;
|
||||
DROP DATABASE dict_db_01036;
|
||||
DROP DATABASE empty_db_01036;
|
||||
CREATE DATABASE IF NOT EXISTS empty_db_01036;
|
||||
SELECT query_count FROM system.dictionaries WHERE database = currentDatabase() AND name = 'dict';
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: no-debug, no-parallel
|
||||
# Tags: no-debug
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
@ -12,20 +12,18 @@ declare -a SearchTypes=("POLYGON" "POLYGON_SIMPLE" "POLYGON_INDEX_EACH" "POLYGON
|
||||
tar -xf "${CURDIR}"/01037_test_data_search.tar.gz -C "${CURDIR}"
|
||||
|
||||
$CLICKHOUSE_CLIENT -n --query="
|
||||
DROP DATABASE IF EXISTS test_01037;
|
||||
CREATE DATABASE test_01037;
|
||||
DROP TABLE IF EXISTS test_01037.points;
|
||||
CREATE TABLE test_01037.points (x Float64, y Float64) ENGINE = Memory;
|
||||
DROP TABLE IF EXISTS points;
|
||||
CREATE TABLE points (x Float64, y Float64) ENGINE = Memory;
|
||||
"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query="INSERT INTO test_01037.points FORMAT TSV" --max_insert_block_size=100000 < "${CURDIR}/01037_point_data"
|
||||
$CLICKHOUSE_CLIENT --query="INSERT INTO points FORMAT TSV" --max_insert_block_size=100000 < "${CURDIR}/01037_point_data"
|
||||
|
||||
rm "${CURDIR}"/01037_point_data
|
||||
|
||||
$CLICKHOUSE_CLIENT -n --query="
|
||||
DROP TABLE IF EXISTS test_01037.polygons_array;
|
||||
DROP TABLE IF EXISTS polygons_array;
|
||||
|
||||
CREATE TABLE test_01037.polygons_array
|
||||
CREATE TABLE polygons_array
|
||||
(
|
||||
key Array(Array(Array(Array(Float64)))),
|
||||
name String,
|
||||
@ -34,7 +32,7 @@ CREATE TABLE test_01037.polygons_array
|
||||
ENGINE = Memory;
|
||||
"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query="INSERT INTO test_01037.polygons_array FORMAT JSONEachRow" --min_chunk_bytes_for_parallel_parsing=10485760 --max_insert_block_size=100000 < "${CURDIR}/01037_polygon_data"
|
||||
$CLICKHOUSE_CLIENT --query="INSERT INTO polygons_array FORMAT JSONEachRow" --min_chunk_bytes_for_parallel_parsing=10485760 --max_insert_block_size=100000 < "${CURDIR}/01037_polygon_data"
|
||||
|
||||
rm "${CURDIR}"/01037_polygon_data
|
||||
|
||||
@ -43,27 +41,22 @@ do
|
||||
outputFile="${TMP_DIR}/results${type}.out"
|
||||
|
||||
$CLICKHOUSE_CLIENT -n --query="
|
||||
DROP DICTIONARY IF EXISTS test_01037.dict_array;
|
||||
DROP DICTIONARY IF EXISTS dict_array;
|
||||
|
||||
CREATE DICTIONARY test_01037.dict_array
|
||||
CREATE DICTIONARY dict_array
|
||||
(
|
||||
key Array(Array(Array(Array(Float64)))),
|
||||
name String DEFAULT 'qqq',
|
||||
value UInt64 DEFAULT 101
|
||||
)
|
||||
PRIMARY KEY key
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'polygons_array' PASSWORD '' DB 'test_01037'))
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'polygons_array' PASSWORD '' DB currentDatabase()))
|
||||
LIFETIME(0)
|
||||
LAYOUT($type());
|
||||
|
||||
select 'dictGet', 'test_01037.dict_array' as dict_name, tuple(x, y) as key,
|
||||
dictGet(dict_name, 'value', key) from test_01037.points order by x, y;
|
||||
select 'dictGet', 'dict_array' as dict_name, tuple(x, y) as key,
|
||||
dictGet(dict_name, 'value', key) from points order by x, y;
|
||||
" > "$outputFile"
|
||||
|
||||
diff -q "${CURDIR}/01037_polygon_dicts_correctness_all.ans" "$outputFile"
|
||||
done
|
||||
|
||||
$CLICKHOUSE_CLIENT -n --query="
|
||||
DROP TABLE test_01037.points;
|
||||
DROP DATABASE test_01037;
|
||||
"
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: no-debug, no-parallel
|
||||
# Tags: no-debug
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
@ -12,20 +12,17 @@ declare -a SearchTypes=("POLYGON_INDEX_EACH" "POLYGON_INDEX_CELL")
|
||||
tar -xf "${CURDIR}"/01037_test_data_perf.tar.gz -C "${CURDIR}"
|
||||
|
||||
$CLICKHOUSE_CLIENT -n --query="
|
||||
DROP DATABASE IF EXISTS test_01037;
|
||||
CREATE DATABASE test_01037;
|
||||
DROP TABLE IF EXISTS test_01037.points;
|
||||
CREATE TABLE test_01037.points (x Float64, y Float64) ENGINE = Memory;
|
||||
CREATE TABLE points (x Float64, y Float64) ENGINE = Memory;
|
||||
"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query="INSERT INTO test_01037.points FORMAT TSV" --min_chunk_bytes_for_parallel_parsing=10485760 --max_insert_block_size=100000 < "${CURDIR}/01037_point_data"
|
||||
$CLICKHOUSE_CLIENT --query="INSERT INTO points FORMAT TSV" --min_chunk_bytes_for_parallel_parsing=10485760 --max_insert_block_size=100000 < "${CURDIR}/01037_point_data"
|
||||
|
||||
rm "${CURDIR}"/01037_point_data
|
||||
|
||||
$CLICKHOUSE_CLIENT -n --query="
|
||||
DROP TABLE IF EXISTS test_01037.polygons_array;
|
||||
DROP TABLE IF EXISTS polygons_array;
|
||||
|
||||
CREATE TABLE test_01037.polygons_array
|
||||
CREATE TABLE polygons_array
|
||||
(
|
||||
key Array(Array(Array(Array(Float64)))),
|
||||
name String,
|
||||
@ -34,7 +31,7 @@ CREATE TABLE test_01037.polygons_array
|
||||
ENGINE = Memory;
|
||||
"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query="INSERT INTO test_01037.polygons_array FORMAT JSONEachRow" --min_chunk_bytes_for_parallel_parsing=10485760 --max_insert_block_size=100000 < "${CURDIR}/01037_polygon_data"
|
||||
$CLICKHOUSE_CLIENT --query="INSERT INTO polygons_array FORMAT JSONEachRow" --min_chunk_bytes_for_parallel_parsing=10485760 --max_insert_block_size=100000 < "${CURDIR}/01037_polygon_data"
|
||||
|
||||
rm "${CURDIR}"/01037_polygon_data
|
||||
|
||||
@ -43,27 +40,23 @@ do
|
||||
outputFile="${TMP_DIR}/results${type}.out"
|
||||
|
||||
$CLICKHOUSE_CLIENT -n --query="
|
||||
DROP DICTIONARY IF EXISTS test_01037.dict_array;
|
||||
DROP DICTIONARY IF EXISTS dict_array;
|
||||
|
||||
CREATE DICTIONARY test_01037.dict_array
|
||||
CREATE DICTIONARY dict_array
|
||||
(
|
||||
key Array(Array(Array(Array(Float64)))),
|
||||
name String DEFAULT 'qqq',
|
||||
value UInt64 DEFAULT 101
|
||||
)
|
||||
PRIMARY KEY key
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'polygons_array' PASSWORD '' DB 'test_01037'))
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'polygons_array' PASSWORD '' DB currentDatabase()))
|
||||
LIFETIME(0)
|
||||
LAYOUT($type());
|
||||
|
||||
select 'dictGet', 'test_01037.dict_array' as dict_name, tuple(x, y) as key,
|
||||
dictGet(dict_name, 'value', key) from test_01037.points order by x, y;
|
||||
select 'dictGet', 'dict_array' as dict_name, tuple(x, y) as key,
|
||||
dictGet(dict_name, 'value', key) from points order by x, y;
|
||||
" > "$outputFile"
|
||||
|
||||
diff -q "${CURDIR}/01037_polygon_dicts_correctness_fast.ans" "$outputFile"
|
||||
done
|
||||
|
||||
$CLICKHOUSE_CLIENT -n --query="
|
||||
DROP TABLE test_01037.points;
|
||||
DROP DATABASE test_01037;
|
||||
"
|
||||
|
@ -5,13 +5,9 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "DROP DATABASE IF EXISTS db_01038"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "CREATE DATABASE db_01038"
|
||||
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "
|
||||
CREATE TABLE db_01038.table_for_dict
|
||||
CREATE TABLE ${CLICKHOUSE_DATABASE}.table_for_dict
|
||||
(
|
||||
key_column UInt64,
|
||||
value Float64
|
||||
@ -19,34 +15,34 @@ CREATE TABLE db_01038.table_for_dict
|
||||
ENGINE = MergeTree()
|
||||
ORDER BY key_column"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "INSERT INTO db_01038.table_for_dict VALUES (1, 1.1)"
|
||||
$CLICKHOUSE_CLIENT --query "INSERT INTO ${CLICKHOUSE_DATABASE}.table_for_dict VALUES (1, 1.1)"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "
|
||||
CREATE DICTIONARY db_01038.dict_with_zero_min_lifetime
|
||||
CREATE DICTIONARY ${CLICKHOUSE_DATABASE}.dict_with_zero_min_lifetime
|
||||
(
|
||||
key_column UInt64,
|
||||
value Float64 DEFAULT 77.77
|
||||
)
|
||||
PRIMARY KEY key_column
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'table_for_dict' DB 'db_01038'))
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'table_for_dict' DB '${CLICKHOUSE_DATABASE}'))
|
||||
LIFETIME(1)
|
||||
LAYOUT(FLAT())"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "SELECT dictGetFloat64('db_01038.dict_with_zero_min_lifetime', 'value', toUInt64(1))"
|
||||
$CLICKHOUSE_CLIENT --query "SELECT dictGetFloat64('${CLICKHOUSE_DATABASE}.dict_with_zero_min_lifetime', 'value', toUInt64(1))"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "SELECT dictGetFloat64('db_01038.dict_with_zero_min_lifetime', 'value', toUInt64(2))"
|
||||
$CLICKHOUSE_CLIENT --query "SELECT dictGetFloat64('${CLICKHOUSE_DATABASE}.dict_with_zero_min_lifetime', 'value', toUInt64(2))"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "INSERT INTO db_01038.table_for_dict VALUES (2, 2.2)"
|
||||
$CLICKHOUSE_CLIENT --query "INSERT INTO ${CLICKHOUSE_DATABASE}.table_for_dict VALUES (2, 2.2)"
|
||||
|
||||
|
||||
function check()
|
||||
{
|
||||
|
||||
query_result=$($CLICKHOUSE_CLIENT --query "SELECT dictGetFloat64('db_01038.dict_with_zero_min_lifetime', 'value', toUInt64(2))")
|
||||
query_result=$($CLICKHOUSE_CLIENT --query "SELECT dictGetFloat64('${CLICKHOUSE_DATABASE}.dict_with_zero_min_lifetime', 'value', toUInt64(2))")
|
||||
|
||||
while [ "$query_result" != "2.2" ]
|
||||
do
|
||||
query_result=$($CLICKHOUSE_CLIENT --query "SELECT dictGetFloat64('db_01038.dict_with_zero_min_lifetime', 'value', toUInt64(2))")
|
||||
query_result=$($CLICKHOUSE_CLIENT --query "SELECT dictGetFloat64('${CLICKHOUSE_DATABASE}.dict_with_zero_min_lifetime', 'value', toUInt64(2))")
|
||||
done
|
||||
}
|
||||
|
||||
@ -55,8 +51,6 @@ export -f check;
|
||||
|
||||
timeout 10 bash -c check
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "SELECT dictGetFloat64('db_01038.dict_with_zero_min_lifetime', 'value', toUInt64(1))"
|
||||
$CLICKHOUSE_CLIENT --query "SELECT dictGetFloat64('${CLICKHOUSE_DATABASE}.dict_with_zero_min_lifetime', 'value', toUInt64(1))"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "SELECT dictGetFloat64('db_01038.dict_with_zero_min_lifetime', 'value', toUInt64(2))"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "DROP DATABASE IF EXISTS db_01038"
|
||||
$CLICKHOUSE_CLIENT --query "SELECT dictGetFloat64('${CLICKHOUSE_DATABASE}.dict_with_zero_min_lifetime', 'value', toUInt64(2))"
|
||||
|
@ -1,17 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: long, no-parallel
|
||||
# Tags: long
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "DROP DATABASE IF EXISTS dictdb_01041_01040"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "CREATE DATABASE dictdb_01041_01040"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "
|
||||
CREATE TABLE dictdb_01041_01040.dict_invalidate
|
||||
CREATE TABLE dict_invalidate
|
||||
ENGINE = Memory AS
|
||||
SELECT
|
||||
122 as dummy,
|
||||
@ -20,31 +15,31 @@ FROM system.one"
|
||||
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "
|
||||
CREATE DICTIONARY dictdb_01041_01040.invalidate
|
||||
CREATE DICTIONARY invalidate
|
||||
(
|
||||
dummy UInt64,
|
||||
two UInt8 EXPRESSION dummy
|
||||
)
|
||||
PRIMARY KEY dummy
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'dict_invalidate' DB 'dictdb_01041_01040' INVALIDATE_QUERY 'select max(last_time) from dictdb_01041_01040.dict_invalidate'))
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'dict_invalidate' DB currentDatabase() INVALIDATE_QUERY 'select max(last_time) from dict_invalidate'))
|
||||
LIFETIME(MIN 0 MAX 1)
|
||||
LAYOUT(FLAT())"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "SELECT dictGetUInt8('dictdb_01041_01040.invalidate', 'two', toUInt64(122))"
|
||||
$CLICKHOUSE_CLIENT --query "SELECT dictGetUInt8('invalidate', 'two', toUInt64(122))"
|
||||
|
||||
# No exception happened
|
||||
$CLICKHOUSE_CLIENT --query "SELECT last_exception FROM system.dictionaries WHERE database = 'dictdb_01041_01040' AND name = 'invalidate'"
|
||||
$CLICKHOUSE_CLIENT --query "SELECT last_exception FROM system.dictionaries WHERE database = currentDatabase() AND name = 'invalidate'"
|
||||
|
||||
$CLICKHOUSE_CLIENT --check_table_dependencies=0 --query "DROP TABLE dictdb_01041_01040.dict_invalidate"
|
||||
$CLICKHOUSE_CLIENT --check_table_dependencies=0 --query "DROP TABLE dict_invalidate"
|
||||
|
||||
function check_exception_detected()
|
||||
{
|
||||
|
||||
query_result=$($CLICKHOUSE_CLIENT --query "SELECT last_exception FROM system.dictionaries WHERE database = 'dictdb_01041_01040' AND name = 'invalidate'" 2>&1)
|
||||
query_result=$($CLICKHOUSE_CLIENT --query "SELECT last_exception FROM system.dictionaries WHERE database = currentDatabase() AND name = 'invalidate'" 2>&1)
|
||||
|
||||
while [ -z "$query_result" ]
|
||||
do
|
||||
query_result=$($CLICKHOUSE_CLIENT --query "SELECT last_exception FROM system.dictionaries WHERE database = 'dictdb_01041_01040' AND name = 'invalidate'" 2>&1)
|
||||
query_result=$($CLICKHOUSE_CLIENT --query "SELECT last_exception FROM system.dictionaries WHERE database = currentDatabase() AND name = 'invalidate'" 2>&1)
|
||||
sleep 0.1
|
||||
done
|
||||
}
|
||||
@ -53,10 +48,10 @@ function check_exception_detected()
|
||||
export -f check_exception_detected;
|
||||
timeout 30 bash -c check_exception_detected 2> /dev/null
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "SELECT last_exception FROM system.dictionaries WHERE database = 'dictdb_01041_01040' AND name = 'invalidate'" 2>&1 | grep -Eo "dictdb_01041_01040.dict_invalidate.*UNKNOWN_TABLE" | wc -l
|
||||
$CLICKHOUSE_CLIENT --query "SELECT last_exception FROM system.dictionaries WHERE database = currentDatabase() AND name = 'invalidate'" 2>&1 | grep -Eo "dict_invalidate.*UNKNOWN_TABLE" | wc -l
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "
|
||||
CREATE TABLE dictdb_01041_01040.dict_invalidate
|
||||
CREATE TABLE dict_invalidate
|
||||
ENGINE = Memory AS
|
||||
SELECT
|
||||
133 as dummy,
|
||||
@ -65,11 +60,11 @@ FROM system.one"
|
||||
|
||||
function check_exception_fixed()
|
||||
{
|
||||
query_result=$($CLICKHOUSE_CLIENT --query "SELECT last_exception FROM system.dictionaries WHERE database = 'dictdb_01041_01040' AND name = 'invalidate'" 2>&1)
|
||||
query_result=$($CLICKHOUSE_CLIENT --query "SELECT last_exception FROM system.dictionaries WHERE database = currentDatabase() AND name = 'invalidate'" 2>&1)
|
||||
|
||||
while [ "$query_result" ]
|
||||
do
|
||||
query_result=$($CLICKHOUSE_CLIENT --query "SELECT last_exception FROM system.dictionaries WHERE database = 'dictdb_01041_01040' AND name = 'invalidate'" 2>&1)
|
||||
query_result=$($CLICKHOUSE_CLIENT --query "SELECT last_exception FROM system.dictionaries WHERE database = currentDatabase() AND name = 'invalidate'" 2>&1)
|
||||
sleep 0.1
|
||||
done
|
||||
}
|
||||
@ -78,7 +73,5 @@ export -f check_exception_fixed;
|
||||
# it may take a while until dictionary reloads
|
||||
timeout 60 bash -c check_exception_fixed 2> /dev/null
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "SELECT last_exception FROM system.dictionaries WHERE database = 'dictdb_01041_01040' AND name = 'invalidate'" 2>&1
|
||||
$CLICKHOUSE_CLIENT --query "SELECT dictGetUInt8('dictdb_01041_01040.invalidate', 'two', toUInt64(133))"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "DROP DATABASE IF EXISTS dictdb_01041_01040"
|
||||
$CLICKHOUSE_CLIENT --query "SELECT last_exception FROM system.dictionaries WHERE database = currentDatabase() AND name = 'invalidate'" 2>&1
|
||||
$CLICKHOUSE_CLIENT --query "SELECT dictGetUInt8('invalidate', 'two', toUInt64(133))"
|
||||
|
@ -1,5 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: no-parallel
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
@ -8,41 +7,37 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
set -e -o pipefail
|
||||
|
||||
# NOTE: dictionaries TTLs works with server timezone, so session_timeout cannot be used
|
||||
$CLICKHOUSE_CLIENT --session_timezone '' --multiquery <<'EOF'
|
||||
DROP DATABASE IF EXISTS dictdb_01042;
|
||||
CREATE DATABASE dictdb_01042;
|
||||
CREATE TABLE dictdb_01042.table(x Int64, y Int64, insert_time DateTime) ENGINE = MergeTree ORDER BY tuple();
|
||||
INSERT INTO dictdb_01042.table VALUES (12, 102, now());
|
||||
$CLICKHOUSE_CLIENT --session_timezone '' --multiquery <<EOF
|
||||
CREATE TABLE ${CLICKHOUSE_DATABASE}.table(x Int64, y Int64, insert_time DateTime) ENGINE = MergeTree ORDER BY tuple();
|
||||
INSERT INTO ${CLICKHOUSE_DATABASE}.table VALUES (12, 102, now());
|
||||
|
||||
CREATE DICTIONARY dictdb_01042.dict
|
||||
CREATE DICTIONARY ${CLICKHOUSE_DATABASE}.dict
|
||||
(
|
||||
x Int64 DEFAULT -1,
|
||||
y Int64 DEFAULT -1,
|
||||
insert_time DateTime
|
||||
)
|
||||
PRIMARY KEY x
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'table' DB 'dictdb_01042' UPDATE_FIELD 'insert_time'))
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'table' DB '${CLICKHOUSE_DATABASE}' UPDATE_FIELD 'insert_time'))
|
||||
LAYOUT(FLAT())
|
||||
LIFETIME(1);
|
||||
EOF
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "SELECT '12 -> ', dictGetInt64('dictdb_01042.dict', 'y', toUInt64(12))"
|
||||
$CLICKHOUSE_CLIENT --query "SELECT '12 -> ', dictGetInt64('${CLICKHOUSE_DATABASE}.dict', 'y', toUInt64(12))"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "INSERT INTO dictdb_01042.table VALUES (13, 103, now())"
|
||||
$CLICKHOUSE_CLIENT --query "INSERT INTO dictdb_01042.table VALUES (14, 104, now() - INTERVAL 1 DAY)"
|
||||
$CLICKHOUSE_CLIENT --query "INSERT INTO ${CLICKHOUSE_DATABASE}.table VALUES (13, 103, now())"
|
||||
$CLICKHOUSE_CLIENT --query "INSERT INTO ${CLICKHOUSE_DATABASE}.table VALUES (14, 104, now() - INTERVAL 1 DAY)"
|
||||
|
||||
while [ "$(${CLICKHOUSE_CLIENT} --query "SELECT dictGetInt64('dictdb_01042.dict', 'y', toUInt64(13))")" = -1 ]
|
||||
while [ "$(${CLICKHOUSE_CLIENT} --query "SELECT dictGetInt64('${CLICKHOUSE_DATABASE}.dict', 'y', toUInt64(13))")" = -1 ]
|
||||
do
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "SELECT '13 -> ', dictGetInt64('dictdb_01042.dict', 'y', toUInt64(13))"
|
||||
$CLICKHOUSE_CLIENT --query "SELECT '14 -> ', dictGetInt64('dictdb_01042.dict', 'y', toUInt64(14))"
|
||||
$CLICKHOUSE_CLIENT --query "SELECT '13 -> ', dictGetInt64('${CLICKHOUSE_DATABASE}.dict', 'y', toUInt64(13))"
|
||||
$CLICKHOUSE_CLIENT --query "SELECT '14 -> ', dictGetInt64('${CLICKHOUSE_DATABASE}.dict', 'y', toUInt64(14))"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "SYSTEM RELOAD DICTIONARY 'dictdb_01042.dict'"
|
||||
$CLICKHOUSE_CLIENT --query "SYSTEM RELOAD DICTIONARY '${CLICKHOUSE_DATABASE}.dict'"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "SELECT '12(r) -> ', dictGetInt64('dictdb_01042.dict', 'y', toUInt64(12))"
|
||||
$CLICKHOUSE_CLIENT --query "SELECT '13(r) -> ', dictGetInt64('dictdb_01042.dict', 'y', toUInt64(13))"
|
||||
$CLICKHOUSE_CLIENT --query "SELECT '14(r) -> ', dictGetInt64('dictdb_01042.dict', 'y', toUInt64(14))"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "DROP DATABASE IF EXISTS dictdb_01042"
|
||||
$CLICKHOUSE_CLIENT --query "SELECT '12(r) -> ', dictGetInt64('${CLICKHOUSE_DATABASE}.dict', 'y', toUInt64(12))"
|
||||
$CLICKHOUSE_CLIENT --query "SELECT '13(r) -> ', dictGetInt64('${CLICKHOUSE_DATABASE}.dict', 'y', toUInt64(13))"
|
||||
$CLICKHOUSE_CLIENT --query "SELECT '14(r) -> ', dictGetInt64('${CLICKHOUSE_DATABASE}.dict', 'y', toUInt64(14))"
|
||||
|
@ -6,8 +6,6 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
USER_FILES_PATH=$($CLICKHOUSE_CLIENT_BINARY --query "select _path,_file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep Exception | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
||||
|
||||
$CLICKHOUSE_CLIENT --allow_deprecated_database_ordinary=1 -n --query="
|
||||
DROP DATABASE IF EXISTS 01053_db;
|
||||
|
||||
|
@ -1,8 +1,3 @@
|
||||
-- Tags: no-parallel
|
||||
|
||||
drop table if exists mt_compact;
|
||||
drop table if exists mt_compact_2;
|
||||
|
||||
create table mt_compact (a Int, s String) engine = MergeTree order by a partition by a
|
||||
settings index_granularity_bytes = 0;
|
||||
alter table mt_compact modify setting min_rows_for_wide_part = 1000; -- { serverError NOT_IMPLEMENTED }
|
||||
@ -25,5 +20,3 @@ alter table mt_compact modify setting parts_to_delay_insert = 300;
|
||||
alter table mt_compact modify setting min_rows_for_wide_part = 0;
|
||||
|
||||
show create table mt_compact;
|
||||
|
||||
drop table mt_compact
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: no-parallel, no-fasttest
|
||||
# Tags: no-fasttest
|
||||
|
||||
set -e
|
||||
|
||||
@ -69,9 +69,6 @@ cat "$DATA_DIR"/simple.null.avro | ${CLICKHOUSE_LOCAL} --input-format Avro --out
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# output
|
||||
echo '===' output
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
-- Tags: no-parallel
|
||||
|
||||
DROP DATABASE IF EXISTS memory_01069;
|
||||
CREATE DATABASE memory_01069 ENGINE = Memory;
|
||||
SHOW CREATE DATABASE memory_01069;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: race, no-parallel
|
||||
# Tags: race
|
||||
|
||||
# This is a monkey test used to trigger sanitizers.
|
||||
|
||||
@ -7,11 +7,8 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
$CLICKHOUSE_CLIENT --query="DROP DATABASE IF EXISTS dictdb_01076;"
|
||||
$CLICKHOUSE_CLIENT --query="CREATE DATABASE dictdb_01076;"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query="
|
||||
CREATE TABLE dictdb_01076.table_datarace
|
||||
CREATE TABLE ${CLICKHOUSE_DATABASE}.table_datarace
|
||||
(
|
||||
key_column UUID,
|
||||
value Float64
|
||||
@ -21,17 +18,17 @@ ORDER BY key_column;
|
||||
"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query="
|
||||
INSERT INTO dictdb_01076.table_datarace VALUES ('cd5db34f-0c25-4375-b10e-bfb3708ddc72', 1.1), ('cd5db34f-0c25-4375-b10e-bfb3708ddc72', 2.2), ('cd5db34f-0c25-4375-b10e-bfb3708ddc72', 3.3);
|
||||
INSERT INTO ${CLICKHOUSE_DATABASE}.table_datarace VALUES ('cd5db34f-0c25-4375-b10e-bfb3708ddc72', 1.1), ('cd5db34f-0c25-4375-b10e-bfb3708ddc72', 2.2), ('cd5db34f-0c25-4375-b10e-bfb3708ddc72', 3.3);
|
||||
"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query="
|
||||
CREATE DICTIONARY IF NOT EXISTS dictdb_01076.dict_datarace
|
||||
CREATE DICTIONARY IF NOT EXISTS ${CLICKHOUSE_DATABASE}.dict_datarace
|
||||
(
|
||||
key_column UInt64,
|
||||
value Float64 DEFAULT 77.77
|
||||
)
|
||||
PRIMARY KEY key_column
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'table_datarace' DB 'dictdb_01076'))
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'table_datarace' DB '${CLICKHOUSE_DATABASE}'))
|
||||
LIFETIME(1)
|
||||
LAYOUT(CACHE(SIZE_IN_CELLS 10));
|
||||
"
|
||||
@ -41,7 +38,7 @@ function thread1()
|
||||
for _ in {1..50}
|
||||
do
|
||||
# This query will be ended with exception, because source dictionary has UUID as a key type.
|
||||
$CLICKHOUSE_CLIENT --query="SELECT dictGetFloat64('dictdb_01076.dict_datarace', 'value', toUInt64(1));"
|
||||
$CLICKHOUSE_CLIENT --query="SELECT dictGetFloat64('${CLICKHOUSE_DATABASE}.dict_datarace', 'value', toUInt64(1));"
|
||||
done
|
||||
}
|
||||
|
||||
@ -51,7 +48,7 @@ function thread2()
|
||||
for _ in {1..50}
|
||||
do
|
||||
# This query will be ended with exception, because source dictionary has UUID as a key type.
|
||||
$CLICKHOUSE_CLIENT --query="SELECT dictGetFloat64('dictdb_01076.dict_datarace', 'value', toUInt64(2));"
|
||||
$CLICKHOUSE_CLIENT --query="SELECT dictGetFloat64('${CLICKHOUSE_DATABASE}.dict_datarace', 'value', toUInt64(2));"
|
||||
done
|
||||
}
|
||||
|
||||
@ -67,6 +64,5 @@ wait
|
||||
|
||||
echo OK
|
||||
|
||||
$CLICKHOUSE_CLIENT --query="DROP DICTIONARY dictdb_01076.dict_datarace;"
|
||||
$CLICKHOUSE_CLIENT --query="DROP TABLE dictdb_01076.table_datarace;"
|
||||
$CLICKHOUSE_CLIENT --query="DROP DATABASE dictdb_01076;"
|
||||
$CLICKHOUSE_CLIENT --query="DROP DICTIONARY ${CLICKHOUSE_DATABASE}.dict_datarace;"
|
||||
$CLICKHOUSE_CLIENT --query="DROP TABLE ${CLICKHOUSE_DATABASE}.table_datarace;"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: zookeeper, no-parallel, no-fasttest
|
||||
# Tags: zookeeper, no-fasttest, no-parallel
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
@ -63,7 +63,7 @@ export -f optimize_thread;
|
||||
export -f insert_thread;
|
||||
|
||||
|
||||
TIMEOUT=30
|
||||
TIMEOUT=20
|
||||
|
||||
# Sometimes we detach and attach tables
|
||||
timeout $TIMEOUT bash -c alter_thread 2> /dev/null &
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: long, zookeeper, no-parallel, no-fasttest
|
||||
# Tags: long, zookeeper, no-fasttest
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
@ -76,7 +76,7 @@ export -f insert_thread;
|
||||
export -f select_thread;
|
||||
|
||||
|
||||
TIMEOUT=30
|
||||
TIMEOUT=20
|
||||
|
||||
|
||||
# Selects should run successfully
|
||||
|
@ -28,7 +28,7 @@ CREATE TABLE url (n UInt64, col String) ENGINE=URL
|
||||
(
|
||||
replace
|
||||
(
|
||||
'https://localhost:8443/?query=' || 'select n, _table from ' || currentDatabase() || '.merge format CSV', ' ', '+'
|
||||
'https://localhost:' || getServerPort('https_port') || '/?query=' || 'select n, _table from ' || currentDatabase() || '.merge format CSV', ' ', '+'
|
||||
),
|
||||
CSV
|
||||
);
|
||||
@ -39,7 +39,7 @@ CREATE VIEW view AS SELECT toInt64(n) as n FROM (SELECT toString(n) as n from me
|
||||
SELECT nonexistentsomething; -- { serverError UNKNOWN_IDENTIFIER }
|
||||
|
||||
CREATE DICTIONARY dict (n UInt64, col String DEFAULT '42') PRIMARY KEY n
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT 9440 SECURE 1 USER 'default' TABLE 'url')) LIFETIME(1) LAYOUT(CACHE(SIZE_IN_CELLS 1));
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT getServerPort('tcp_port_secure') SECURE 1 USER 'default' TABLE 'url')) LIFETIME(1) LAYOUT(CACHE(SIZE_IN_CELLS 1));
|
||||
|
||||
-- dict --> url --> merge |-> distributed -> file (1)
|
||||
-- |-> distributed_tf -> buffer -> file (1)
|
||||
|
@ -1,14 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: no-fasttest, no-parallel
|
||||
# Tags: no-fasttest
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
|
||||
USER_FILES_PATH=$($CLICKHOUSE_CLIENT_BINARY --query "select _path,_file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep Exception | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
||||
|
||||
|
||||
$CLICKHOUSE_CLIENT --query="DROP TABLE IF EXISTS msgpack";
|
||||
|
||||
$CLICKHOUSE_CLIENT --query="CREATE TABLE msgpack (uint8 UInt8, uint16 UInt16, uint32 UInt32, uint64 UInt64, int8 Int8, int16 Int16, int32 Int32, int64 Int64, float Float32, double Float64, string String, date Date, datetime DateTime('Asia/Istanbul'), datetime64 DateTime64(3, 'Asia/Istanbul'), array Array(UInt32)) ENGINE = Memory";
|
||||
|
@ -87,7 +87,7 @@ function insert()
|
||||
|
||||
|
||||
|
||||
TIMEOUT=30
|
||||
TIMEOUT=20
|
||||
|
||||
create_db $TIMEOUT &
|
||||
sync_db $TIMEOUT &
|
||||
|
@ -1,29 +1,21 @@
|
||||
-- Tags: no-parallel
|
||||
|
||||
DROP DATABASE IF EXISTS database_for_dict;
|
||||
|
||||
CREATE DATABASE database_for_dict;
|
||||
|
||||
CREATE TABLE database_for_dict.table_for_dict (
|
||||
CREATE TABLE table_for_dict (
|
||||
CompanyID String,
|
||||
OSType Enum('UNKNOWN' = 0, 'WINDOWS' = 1, 'LINUX' = 2, 'ANDROID' = 3, 'MAC' = 4),
|
||||
SomeID Int32
|
||||
)
|
||||
ENGINE = Memory();
|
||||
|
||||
INSERT INTO database_for_dict.table_for_dict VALUES ('First', 'WINDOWS', 1), ('Second', 'LINUX', 2);
|
||||
INSERT INTO table_for_dict VALUES ('First', 'WINDOWS', 1), ('Second', 'LINUX', 2);
|
||||
|
||||
CREATE DICTIONARY database_for_dict.dict_with_conversion
|
||||
CREATE DICTIONARY dict_with_conversion
|
||||
(
|
||||
CompanyID String DEFAULT '',
|
||||
OSType String DEFAULT '',
|
||||
SomeID Int32 DEFAULT 0
|
||||
)
|
||||
PRIMARY KEY CompanyID
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'table_for_dict' DB 'database_for_dict'))
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'table_for_dict' DB currentDatabase()))
|
||||
LIFETIME(MIN 1 MAX 20)
|
||||
LAYOUT(COMPLEX_KEY_HASHED());
|
||||
|
||||
SELECT * FROM database_for_dict.dict_with_conversion ORDER BY CompanyID;
|
||||
|
||||
DROP DATABASE IF EXISTS database_for_dict;
|
||||
SELECT * FROM dict_with_conversion ORDER BY CompanyID;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: no-parallel, no-fasttest
|
||||
# Tags: no-fasttest
|
||||
# Tag no-fasttest: 45 seconds running
|
||||
|
||||
# Creation of a database with Ordinary engine emits a warning.
|
||||
|
@ -1,4 +1,4 @@
|
||||
-- Tags: no-parallel, no-fasttest
|
||||
-- Tags: no-fasttest
|
||||
|
||||
DROP DATABASE IF EXISTS conv_main;
|
||||
CREATE DATABASE conv_main ENGINE = MySQL('127.0.0.1:3456', conv_main, 'metrika', 'password'); -- { serverError CANNOT_CREATE_DATABASE }
|
||||
|
@ -1,11 +1,3 @@
|
||||
-- Tags: no-parallel
|
||||
|
||||
DROP DATABASE IF EXISTS database_for_dict;
|
||||
|
||||
CREATE DATABASE database_for_dict;
|
||||
|
||||
use database_for_dict;
|
||||
|
||||
CREATE TABLE date_table
|
||||
(
|
||||
id UInt32,
|
||||
@ -24,7 +16,7 @@ CREATE DICTIONARY somedict
|
||||
end Date
|
||||
)
|
||||
PRIMARY KEY id
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'date_table' DB 'database_for_dict'))
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'date_table' DB currentDatabase()))
|
||||
LAYOUT(RANGE_HASHED())
|
||||
RANGE (MIN start MAX end)
|
||||
LIFETIME(MIN 300 MAX 360);
|
||||
@ -35,5 +27,3 @@ SELECT * from somedict;
|
||||
SELECT 1 FROM somedict;
|
||||
|
||||
SHOW TABLES;
|
||||
|
||||
DROP DATABASE database_for_dict;
|
||||
|
@ -1,6 +1,3 @@
|
||||
-- Tags: no-parallel
|
||||
|
||||
DROP TABLE IF EXISTS mt;
|
||||
set allow_deprecated_syntax_for_merge_tree=1;
|
||||
CREATE TABLE mt (d Date, x String) ENGINE = MergeTree(d, x, 8192);
|
||||
INSERT INTO mt VALUES ('2106-02-07', 'Hello'), ('1970-01-01', 'World');
|
||||
|
@ -107,7 +107,7 @@ export -f drop_partition_thread;
|
||||
export -f optimize_thread;
|
||||
export -f drop_part_thread;
|
||||
|
||||
TIMEOUT=60
|
||||
TIMEOUT=40
|
||||
|
||||
#timeout $TIMEOUT bash -c "create_drop_thread ${engines[@]}" &
|
||||
timeout $TIMEOUT bash -c 'insert_thread src' &
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: long, no-parallel, no-ordinary-database, no-debug
|
||||
# Tags: long, no-ordinary-database, no-debug
|
||||
# Test is too heavy, avoid parallel run in Flaky Check
|
||||
# shellcheck disable=SC2119
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
-- Tags: no-ordinary-database, no-parallel
|
||||
-- Tags: no-ordinary-database
|
||||
|
||||
drop table if exists t1;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
-- Tags: no-replicated-database, no-parallel
|
||||
-- Tags: no-replicated-database
|
||||
|
||||
drop table if exists test;
|
||||
drop table if exists file;
|
||||
|
@ -1,22 +1,15 @@
|
||||
-- Tags: no-parallel
|
||||
|
||||
DROP DATABASE IF EXISTS dict_db_01225;
|
||||
CREATE DATABASE dict_db_01225;
|
||||
|
||||
CREATE TABLE dict_db_01225.dict_data (key UInt64, val UInt64) Engine=Memory();
|
||||
CREATE DICTIONARY dict_db_01225.dict
|
||||
CREATE TABLE dict_data (key UInt64, val UInt64) Engine=Memory();
|
||||
CREATE DICTIONARY dict
|
||||
(
|
||||
key UInt64 DEFAULT 0,
|
||||
val UInt64 DEFAULT 10
|
||||
)
|
||||
PRIMARY KEY key
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'dict_data' PASSWORD '' DB 'dict_db_01225'))
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'dict_data' PASSWORD '' DB currentDatabase()))
|
||||
LIFETIME(MIN 0 MAX 0)
|
||||
LAYOUT(FLAT());
|
||||
|
||||
SYSTEM RELOAD DICTIONARY dict_db_01225.dict;
|
||||
SYSTEM RELOAD DICTIONARY dict;
|
||||
|
||||
DROP TABLE dict_db_01225.dict; -- { serverError CANNOT_DETACH_DICTIONARY_AS_TABLE }
|
||||
DROP DICTIONARY dict_db_01225.dict;
|
||||
|
||||
DROP DATABASE dict_db_01225;
|
||||
DROP TABLE dict; -- { serverError CANNOT_DETACH_DICTIONARY_AS_TABLE }
|
||||
DROP DICTIONARY dict;
|
||||
|
@ -1,9 +1,3 @@
|
||||
-- Tags: no-parallel
|
||||
|
||||
DROP DATABASE IF EXISTS dict_db_01254;
|
||||
CREATE DATABASE dict_db_01254;
|
||||
USE dict_db_01254;
|
||||
|
||||
CREATE TABLE dict_data (key UInt64, val UInt64) Engine=Memory();
|
||||
CREATE DICTIONARY dict
|
||||
(
|
||||
@ -11,15 +5,12 @@ CREATE DICTIONARY dict
|
||||
val UInt64 DEFAULT 10
|
||||
)
|
||||
PRIMARY KEY key
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'dict_data' PASSWORD '' DB 'dict_db_01254'))
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'dict_data' PASSWORD '' DB currentDatabase()))
|
||||
LIFETIME(MIN 0 MAX 0)
|
||||
LAYOUT(FLAT());
|
||||
|
||||
SELECT query_count, status FROM system.dictionaries WHERE database = 'dict_db_01254' AND name = 'dict';
|
||||
SYSTEM RELOAD DICTIONARY dict_db_01254.dict;
|
||||
SELECT query_count, status FROM system.dictionaries WHERE database = 'dict_db_01254' AND name = 'dict';
|
||||
SELECT dictGetUInt64('dict_db_01254.dict', 'val', toUInt64(0));
|
||||
SELECT query_count, status FROM system.dictionaries WHERE database = 'dict_db_01254' AND name = 'dict';
|
||||
|
||||
USE system;
|
||||
DROP DATABASE dict_db_01254;
|
||||
SELECT query_count, status FROM system.dictionaries WHERE database = currentDatabase() AND name = 'dict';
|
||||
SYSTEM RELOAD DICTIONARY dict;
|
||||
SELECT query_count, status FROM system.dictionaries WHERE database = currentDatabase() AND name = 'dict';
|
||||
SELECT dictGetUInt64('dict', 'val', toUInt64(0));
|
||||
SELECT query_count, status FROM system.dictionaries WHERE database = currentDatabase() AND name = 'dict';
|
||||
|
@ -1,26 +1,19 @@
|
||||
-- Tags: no-parallel
|
||||
|
||||
DROP DATABASE IF EXISTS dict_db_01254;
|
||||
CREATE DATABASE dict_db_01254;
|
||||
|
||||
CREATE TABLE dict_db_01254.dict_data (key UInt64, val UInt64) Engine=Memory();
|
||||
CREATE DICTIONARY dict_db_01254.dict
|
||||
CREATE TABLE dict_data (key UInt64, val UInt64) Engine=Memory();
|
||||
CREATE DICTIONARY dict
|
||||
(
|
||||
key UInt64 DEFAULT 0,
|
||||
val UInt64 DEFAULT 10
|
||||
)
|
||||
PRIMARY KEY key
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'dict_data' PASSWORD '' DB 'dict_db_01254'))
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'dict_data' PASSWORD '' DB currentDatabase()))
|
||||
LIFETIME(MIN 0 MAX 0)
|
||||
LAYOUT(FLAT());
|
||||
|
||||
DETACH DATABASE dict_db_01254;
|
||||
ATTACH DATABASE dict_db_01254;
|
||||
DETACH DATABASE {CLICKHOUSE_DATABASE:Identifier};
|
||||
ATTACH DATABASE {CLICKHOUSE_DATABASE:Identifier};
|
||||
|
||||
SELECT COALESCE((SELECT status FROM system.dictionaries WHERE database = 'dict_db_01254' AND name = 'dict')::Nullable(String), 'NOT_LOADED');
|
||||
SYSTEM RELOAD DICTIONARY dict_db_01254.dict;
|
||||
SELECT query_count, status FROM system.dictionaries WHERE database = 'dict_db_01254' AND name = 'dict';
|
||||
SELECT dictGetUInt64('dict_db_01254.dict', 'val', toUInt64(0));
|
||||
SELECT query_count, status FROM system.dictionaries WHERE database = 'dict_db_01254' AND name = 'dict';
|
||||
|
||||
DROP DATABASE dict_db_01254;
|
||||
SELECT COALESCE((SELECT status FROM system.dictionaries WHERE database = currentDatabase() AND name = 'dict')::Nullable(String), 'NOT_LOADED');
|
||||
SYSTEM RELOAD DICTIONARY dict;
|
||||
SELECT query_count, status FROM system.dictionaries WHERE database = currentDatabase() AND name = 'dict';
|
||||
SELECT dictGetUInt64('dict', 'val', toUInt64(0));
|
||||
SELECT query_count, status FROM system.dictionaries WHERE database = currentDatabase() AND name = 'dict';
|
||||
|
@ -1,12 +1,6 @@
|
||||
-- Tags: no-parallel, no-fasttest
|
||||
-- Tags: no-fasttest
|
||||
|
||||
DROP DATABASE IF EXISTS database_for_dict;
|
||||
|
||||
CREATE DATABASE database_for_dict;
|
||||
|
||||
DROP TABLE IF EXISTS database_for_dict.table_for_dict;
|
||||
|
||||
CREATE TABLE database_for_dict.table_for_dict
|
||||
CREATE TABLE table_for_dict
|
||||
(
|
||||
key_column UInt64,
|
||||
second_column UInt64,
|
||||
@ -15,7 +9,7 @@ CREATE TABLE database_for_dict.table_for_dict
|
||||
ENGINE = MergeTree()
|
||||
ORDER BY key_column;
|
||||
|
||||
INSERT INTO database_for_dict.table_for_dict VALUES (100500, 10000000, 'Hello world');
|
||||
INSERT INTO table_for_dict VALUES (100500, 10000000, 'Hello world');
|
||||
|
||||
DROP DATABASE IF EXISTS ordinary_db;
|
||||
|
||||
@ -30,7 +24,7 @@ CREATE DICTIONARY ordinary_db.dict1
|
||||
third_column String DEFAULT 'qqq'
|
||||
)
|
||||
PRIMARY KEY key_column
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'table_for_dict' PASSWORD '' DB 'database_for_dict'))
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'table_for_dict' PASSWORD '' DB currentDatabase()))
|
||||
LIFETIME(MIN 1 MAX 10)
|
||||
LAYOUT(FLAT()) SETTINGS(max_result_bytes=1);
|
||||
|
||||
@ -40,10 +34,6 @@ SELECT dictGetUInt64('ordinary_db.dict1', 'second_column', toUInt64(100500)); --
|
||||
|
||||
SELECT 'END';
|
||||
|
||||
DROP DICTIONARY IF EXISTS ordinary_db.dict1;
|
||||
|
||||
DROP DATABASE IF EXISTS ordinary_db;
|
||||
|
||||
DROP TABLE IF EXISTS database_for_dict.table_for_dict;
|
||||
|
||||
DROP DATABASE IF EXISTS database_for_dict;
|
||||
DROP TABLE IF EXISTS table_for_dict;
|
||||
|
@ -1,5 +1,3 @@
|
||||
-- Tags: no-parallel
|
||||
|
||||
DROP TABLE IF EXISTS data_01269;
|
||||
CREATE TABLE data_01269
|
||||
(
|
||||
|
@ -1,9 +1,5 @@
|
||||
-- Tags: no-parallel
|
||||
|
||||
DROP TABLE IF EXISTS codecs;
|
||||
|
||||
-- test what should work
|
||||
|
||||
CREATE TABLE codecs
|
||||
(
|
||||
a UInt8 CODEC(LZ4),
|
||||
|
@ -5,8 +5,6 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
USER_FILES_PATH=$($CLICKHOUSE_CLIENT_BINARY --query "select _path,_file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep Exception | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
||||
|
||||
$CLICKHOUSE_CLIENT -n --query="
|
||||
set allow_deprecated_database_ordinary=1;
|
||||
DROP DATABASE IF EXISTS 01280_db;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: long, no-parallel, no-fasttest
|
||||
# Tags: long, no-fasttest
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
@ -91,7 +91,7 @@ ${CLICKHOUSE_CLIENT} -n -q "
|
||||
"
|
||||
|
||||
|
||||
TIMEOUT=30
|
||||
TIMEOUT=20
|
||||
|
||||
timeout $TIMEOUT bash -c recreate_lazy_func1 2> /dev/null &
|
||||
timeout $TIMEOUT bash -c recreate_lazy_func2 2> /dev/null &
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: no-parallel, no-fasttest
|
||||
# Tags: no-fasttest
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: no-parallel, no-fasttest
|
||||
# Tags: no-fasttest
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: long, no-parallel
|
||||
# Tags: long
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: long, zookeeper, no-parallel
|
||||
# Tags: long, zookeeper
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
|
@ -1,28 +1,26 @@
|
||||
-- Tags: no-parallel
|
||||
|
||||
DROP TABLE IF EXISTS alter_test;
|
||||
DROP TABLE IF EXISTS alter_01355;
|
||||
|
||||
set allow_deprecated_syntax_for_merge_tree=1;
|
||||
CREATE TABLE alter_test (CounterID UInt32, StartDate Date, UserID UInt32, VisitID UInt32, NestedColumn Nested(A UInt8, S String), ToDrop UInt32) ENGINE = MergeTree(StartDate, intHash32(UserID), (CounterID, StartDate, intHash32(UserID), VisitID), 8192);
|
||||
CREATE TABLE alter_01355 (CounterID UInt32, StartDate Date, UserID UInt32, VisitID UInt32, NestedColumn Nested(A UInt8, S String), ToDrop UInt32) ENGINE = MergeTree(StartDate, intHash32(UserID), (CounterID, StartDate, intHash32(UserID), VisitID), 8192);
|
||||
|
||||
ALTER TABLE alter_test ADD COLUMN Added1 UInt32 FIRST;
|
||||
ALTER TABLE alter_01355 ADD COLUMN Added1 UInt32 FIRST;
|
||||
|
||||
ALTER TABLE alter_test ADD COLUMN Added2 UInt32 AFTER NestedColumn;
|
||||
ALTER TABLE alter_01355 ADD COLUMN Added2 UInt32 AFTER NestedColumn;
|
||||
|
||||
ALTER TABLE alter_test ADD COLUMN Added3 UInt32 AFTER ToDrop;
|
||||
ALTER TABLE alter_01355 ADD COLUMN Added3 UInt32 AFTER ToDrop;
|
||||
|
||||
DESC alter_test;
|
||||
DETACH TABLE alter_test;
|
||||
ATTACH TABLE alter_test;
|
||||
DESC alter_test;
|
||||
DESC alter_01355;
|
||||
DETACH TABLE alter_01355;
|
||||
ATTACH TABLE alter_01355;
|
||||
DESC alter_01355;
|
||||
|
||||
ALTER TABLE alter_test MODIFY COLUMN Added2 UInt32 FIRST;
|
||||
ALTER TABLE alter_01355 MODIFY COLUMN Added2 UInt32 FIRST;
|
||||
|
||||
ALTER TABLE alter_test MODIFY COLUMN Added3 UInt32 AFTER CounterID;
|
||||
ALTER TABLE alter_01355 MODIFY COLUMN Added3 UInt32 AFTER CounterID;
|
||||
|
||||
DESC alter_test;
|
||||
DETACH TABLE alter_test;
|
||||
ATTACH TABLE alter_test;
|
||||
DESC alter_test;
|
||||
DESC alter_01355;
|
||||
DETACH TABLE alter_01355;
|
||||
ATTACH TABLE alter_01355;
|
||||
DESC alter_01355;
|
||||
|
||||
DROP TABLE IF EXISTS alter_test;
|
||||
DROP TABLE IF EXISTS alter_01355;
|
||||
|
@ -1,4 +1,4 @@
|
||||
-- Tags: no-parallel, no-fasttest
|
||||
-- Tags: no-fasttest
|
||||
|
||||
SELECT 'Hello' ILIKE '';
|
||||
SELECT 'Hello' ILIKE '%';
|
||||
@ -53,11 +53,7 @@ SELECT 'ощщЁё' ILIKE '%щ%';
|
||||
SELECT 'ощЩЁё' ILIKE '%ё%';
|
||||
|
||||
SHOW TABLES NOT ILIKE '%';
|
||||
DROP DATABASE IF EXISTS test_01355;
|
||||
CREATE DATABASE test_01355;
|
||||
USE test_01355;
|
||||
CREATE TABLE test1 (x UInt8) ENGINE = Memory;
|
||||
CREATE TABLE test2 (x UInt8) ENGINE = Memory;
|
||||
SHOW TABLES ILIKE 'tES%';
|
||||
SHOW TABLES NOT ILIKE 'TeS%';
|
||||
DROP DATABASE test_01355;
|
||||
|
@ -1,5 +1,3 @@
|
||||
-- Tags: no-parallel
|
||||
|
||||
DROP TABLE IF EXISTS test;
|
||||
CREATE TABLE test (x UInt8) ENGINE = MergeTree ORDER BY tuple();
|
||||
INSERT INTO test (x) VALUES (1), (2), (3);
|
||||
|
@ -1,13 +1,3 @@
|
||||
-- Tags: no-parallel
|
||||
|
||||
DROP DATABASE IF EXISTS db_01391;
|
||||
CREATE DATABASE db_01391;
|
||||
USE db_01391;
|
||||
|
||||
DROP TABLE IF EXISTS t;
|
||||
DROP TABLE IF EXISTS d_src;
|
||||
DROP DICTIONARY IF EXISTS d;
|
||||
|
||||
CREATE TABLE t (click_city_id UInt32, click_country_id UInt32) Engine = Memory;
|
||||
CREATE TABLE d_src (id UInt64, country_id UInt8, name String) Engine = Memory;
|
||||
|
||||
@ -16,14 +6,9 @@ INSERT INTO d_src VALUES (0, 0, 'n');
|
||||
|
||||
CREATE DICTIONARY d (id UInt32, country_id UInt8, name String)
|
||||
PRIMARY KEY id
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' DB 'db_01391' table 'd_src'))
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' DB currentDatabase() table 'd_src'))
|
||||
LIFETIME(MIN 1 MAX 1)
|
||||
LAYOUT(HASHED());
|
||||
|
||||
SELECT click_country_id FROM t AS cc LEFT JOIN d ON toUInt32(d.id) = cc.click_city_id;
|
||||
SELECT click_country_id FROM t AS cc LEFT JOIN d ON d.country_id < 99 AND d.id = cc.click_city_id;
|
||||
|
||||
DROP DICTIONARY d;
|
||||
DROP TABLE t;
|
||||
DROP TABLE d_src;
|
||||
DROP DATABASE IF EXISTS db_01391;
|
||||
|
@ -1,16 +1,11 @@
|
||||
-- Tags: no-parallel
|
||||
CREATE TABLE tableConversion (conversionId String, value Nullable(Double)) ENGINE = Log();
|
||||
CREATE TABLE tableClick (clickId String, conversionId String, value Nullable(Double)) ENGINE = Log();
|
||||
CREATE TABLE leftjoin (id String) ENGINE = Log();
|
||||
|
||||
DROP DATABASE IF EXISTS test_01392;
|
||||
CREATE DATABASE test_01392;
|
||||
|
||||
CREATE TABLE test_01392.tableConversion (conversionId String, value Nullable(Double)) ENGINE = Log();
|
||||
CREATE TABLE test_01392.tableClick (clickId String, conversionId String, value Nullable(Double)) ENGINE = Log();
|
||||
CREATE TABLE test_01392.leftjoin (id String) ENGINE = Log();
|
||||
|
||||
INSERT INTO test_01392.tableConversion(conversionId, value) VALUES ('Conversion 1', 1);
|
||||
INSERT INTO test_01392.tableClick(clickId, conversionId, value) VALUES ('Click 1', 'Conversion 1', 14);
|
||||
INSERT INTO test_01392.tableClick(clickId, conversionId, value) VALUES ('Click 2', 'Conversion 1', 15);
|
||||
INSERT INTO test_01392.tableClick(clickId, conversionId, value) VALUES ('Click 3', 'Conversion 1', 16);
|
||||
INSERT INTO tableConversion(conversionId, value) VALUES ('Conversion 1', 1);
|
||||
INSERT INTO tableClick(clickId, conversionId, value) VALUES ('Click 1', 'Conversion 1', 14);
|
||||
INSERT INTO tableClick(clickId, conversionId, value) VALUES ('Click 2', 'Conversion 1', 15);
|
||||
INSERT INTO tableClick(clickId, conversionId, value) VALUES ('Click 3', 'Conversion 1', 16);
|
||||
|
||||
SELECT
|
||||
conversion.conversionId AS myConversionId,
|
||||
@ -18,19 +13,13 @@ SELECT
|
||||
click.myValue AS myValue
|
||||
FROM (
|
||||
SELECT conversionId, value as myValue
|
||||
FROM test_01392.tableConversion
|
||||
FROM tableConversion
|
||||
) AS conversion
|
||||
INNER JOIN (
|
||||
SELECT clickId, conversionId, value as myValue
|
||||
FROM test_01392.tableClick
|
||||
FROM tableClick
|
||||
) AS click ON click.conversionId = conversion.conversionId
|
||||
LEFT JOIN (
|
||||
SELECT * FROM test_01392.leftjoin
|
||||
SELECT * FROM leftjoin
|
||||
) AS dummy ON (dummy.id = conversion.conversionId)
|
||||
ORDER BY myValue;
|
||||
|
||||
DROP TABLE test_01392.tableConversion;
|
||||
DROP TABLE test_01392.tableClick;
|
||||
DROP TABLE test_01392.leftjoin;
|
||||
|
||||
DROP DATABASE test_01392;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: replica, no-debug, no-parallel
|
||||
# Tags: replica, no-debug
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: race, no-parallel
|
||||
# Tags: race
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
@ -54,7 +54,7 @@ function drop_create_table_thread()
|
||||
export -f dict_get_thread;
|
||||
export -f drop_create_table_thread;
|
||||
|
||||
TIMEOUT=30
|
||||
TIMEOUT=20
|
||||
|
||||
timeout $TIMEOUT bash -c dict_get_thread 2> /dev/null &
|
||||
timeout $TIMEOUT bash -c dict_get_thread 2> /dev/null &
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: no-replicated-database, no-parallel
|
||||
# Tags: no-replicated-database
|
||||
|
||||
set -e
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: long, no-parallel, no-debug
|
||||
# Tags: long, no-debug
|
||||
|
||||
set -e
|
||||
|
||||
@ -27,7 +27,7 @@ function thread_ops()
|
||||
}
|
||||
export -f thread_ops
|
||||
|
||||
TIMEOUT=60
|
||||
TIMEOUT=30
|
||||
thread_ops $TIMEOUT &
|
||||
wait
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: race, no-parallel
|
||||
# Tags: race
|
||||
|
||||
set -e
|
||||
|
||||
@ -8,20 +8,20 @@ CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
. "$CUR_DIR"/../shell_config.sh
|
||||
|
||||
# This test reproduces "Directory not empty" error in DROP DATABASE query.
|
||||
export DB=test_$RANDOM
|
||||
|
||||
function thread1()
|
||||
{
|
||||
while true; do
|
||||
# ${CLICKHOUSE_CLIENT} --query="SHOW TABLES FROM test_01444"
|
||||
${CLICKHOUSE_CLIENT} --query="DROP DATABASE IF EXISTS test_01444" 2>&1| grep -F "Code: " | grep -Fv "Code: 219"
|
||||
${CLICKHOUSE_CLIENT} --query="CREATE DATABASE IF NOT EXISTS test_01444"
|
||||
${CLICKHOUSE_CLIENT} --query="DROP DATABASE IF EXISTS $DB" 2>&1| grep -F "Code: " | grep -Fv "Code: 219"
|
||||
${CLICKHOUSE_CLIENT} --query="CREATE DATABASE IF NOT EXISTS $DB"
|
||||
done
|
||||
}
|
||||
|
||||
function thread2()
|
||||
{
|
||||
while true; do
|
||||
${CLICKHOUSE_CLIENT} --query="CREATE TABLE IF NOT EXISTS test_01444.t$RANDOM (x UInt8) ENGINE = MergeTree ORDER BY tuple()" 2>/dev/null
|
||||
${CLICKHOUSE_CLIENT} --query="CREATE TABLE IF NOT EXISTS $DB.t$RANDOM (x UInt8) ENGINE = MergeTree ORDER BY tuple()" 2>/dev/null
|
||||
done
|
||||
}
|
||||
|
||||
@ -36,4 +36,4 @@ timeout $TIMEOUT bash -c thread2 &
|
||||
|
||||
wait
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query="DROP DATABASE IF EXISTS test_01444" 2>&1| grep -F "Code: " | grep -Fv "Code: 219" || exit 0
|
||||
${CLICKHOUSE_CLIENT} --query="DROP DATABASE IF EXISTS ${DB}" 2>&1| grep -F "Code: " | grep -Fv "Code: 219" || exit 0
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: race, no-parallel
|
||||
# Tags: race
|
||||
|
||||
set -e
|
||||
|
||||
@ -36,8 +36,8 @@ function g {
|
||||
export -f f;
|
||||
export -f g;
|
||||
|
||||
timeout 30 bash -c f > /dev/null &
|
||||
timeout 30 bash -c g > /dev/null &
|
||||
timeout 20 bash -c f > /dev/null &
|
||||
timeout 20 bash -c g > /dev/null &
|
||||
wait
|
||||
|
||||
$CLICKHOUSE_CLIENT -q "DROP TABLE mem"
|
||||
|
@ -5,8 +5,6 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
USER_FILES_PATH=$($CLICKHOUSE_CLIENT_BINARY --query "select _path,_file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep Exception | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
||||
|
||||
$CLICKHOUSE_CLIENT --multiquery --query "
|
||||
SET allow_suspicious_low_cardinality_types=1;
|
||||
CREATE TABLE IF NOT EXISTS test_01543 (value LowCardinality(String), value2 LowCardinality(UInt64)) ENGINE=Memory();
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: no-parallel, no-fasttest
|
||||
# Tags: no-fasttest, no-parallel
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
@ -39,7 +39,7 @@ function kill_mutation_thread
|
||||
export -f alter_thread;
|
||||
export -f kill_mutation_thread;
|
||||
|
||||
TIMEOUT=30
|
||||
TIMEOUT=20
|
||||
|
||||
timeout $TIMEOUT bash -c alter_thread 2> /dev/null &
|
||||
timeout $TIMEOUT bash -c kill_mutation_thread 2> /dev/null &
|
||||
|
@ -7,18 +7,11 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
# Data preparation.
|
||||
|
||||
# Now we can get the user_files_path by use the table file function for trick. also we can get it by query as:
|
||||
# "insert into function file('exist.txt', 'CSV', 'val1 char') values ('aaaa'); select _path from file('exist.txt', 'CSV', 'val1 char')"
|
||||
CLICKHOUSE_USER_FILES_PATH=$(clickhouse-client --query "select _path, _file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep Exception | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
||||
|
||||
mkdir -p ${CLICKHOUSE_USER_FILES_PATH}/
|
||||
echo -n aaaaaaaaa > ${CLICKHOUSE_USER_FILES_PATH}/a.txt
|
||||
echo -n bbbbbbbbb > ${CLICKHOUSE_USER_FILES_PATH}/b.txt
|
||||
echo -n ccccccccc > ${CLICKHOUSE_USER_FILES_PATH}/c.txt
|
||||
echo -n aaaaaaaaa > ${USER_FILES_PATH}/a.txt
|
||||
echo -n bbbbbbbbb > ${USER_FILES_PATH}/b.txt
|
||||
echo -n ccccccccc > ${USER_FILES_PATH}/c.txt
|
||||
echo -n ccccccccc > /tmp/c.txt
|
||||
mkdir -p ${CLICKHOUSE_USER_FILES_PATH}/dir
|
||||
mkdir -p ${USER_FILES_PATH}/dir
|
||||
|
||||
|
||||
### 1st TEST in CLIENT mode.
|
||||
@ -85,15 +78,15 @@ echo "${CLICKHOUSE_LOCAL} --query "'"select file('"'dir'), file('b.txt')"'";echo
|
||||
|
||||
# Test that the function is not injective
|
||||
|
||||
echo -n Hello > ${CLICKHOUSE_USER_FILES_PATH}/a
|
||||
echo -n Hello > ${CLICKHOUSE_USER_FILES_PATH}/b
|
||||
echo -n World > ${CLICKHOUSE_USER_FILES_PATH}/c
|
||||
echo -n Hello > ${USER_FILES_PATH}/a
|
||||
echo -n Hello > ${USER_FILES_PATH}/b
|
||||
echo -n World > ${USER_FILES_PATH}/c
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "SELECT file(arrayJoin(['a', 'b', 'c'])) AS s, count() GROUP BY s ORDER BY s"
|
||||
${CLICKHOUSE_CLIENT} --query "SELECT s, count() FROM file('?', TSV, 's String') GROUP BY s ORDER BY s"
|
||||
|
||||
# Restore
|
||||
rm ${CLICKHOUSE_USER_FILES_PATH}/{a,b,c}.txt
|
||||
rm ${CLICKHOUSE_USER_FILES_PATH}/{a,b,c}
|
||||
rm ${USER_FILES_PATH}/{a,b,c}.txt
|
||||
rm ${USER_FILES_PATH}/{a,b,c}
|
||||
rm /tmp/c.txt
|
||||
rm -rf ${CLICKHOUSE_USER_FILES_PATH}/dir
|
||||
rm -rf ${USER_FILES_PATH}/dir
|
||||
|
@ -5,8 +5,6 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
USER_FILES_PATH=$($CLICKHOUSE_CLIENT_BINARY --query "select _path,_file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep Exception | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
||||
|
||||
$CLICKHOUSE_CLIENT -n --query="
|
||||
DROP DATABASE IF EXISTS 01684_database_for_cache_dictionary;
|
||||
CREATE DATABASE 01684_database_for_cache_dictionary;
|
||||
|
@ -5,8 +5,6 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
USER_FILES_PATH=$($CLICKHOUSE_CLIENT_BINARY --query "select _path,_file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep Exception | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
||||
|
||||
$CLICKHOUSE_CLIENT -n --query="
|
||||
DROP DATABASE IF EXISTS 01685_database_for_cache_dictionary;
|
||||
CREATE DATABASE 01685_database_for_cache_dictionary;
|
||||
|
@ -1,4 +1,4 @@
|
||||
-- Tags: long, no-parallel
|
||||
-- Tags: long
|
||||
|
||||
drop table if exists t;
|
||||
|
||||
|
@ -25,7 +25,7 @@ create table dictst01747(some_name String, field1 String, field2 UInt8) Engine =
|
||||
as select 'name', 'test', 33;
|
||||
|
||||
CREATE DICTIONARY default.dict01747 (some_name String, field1 String, field2 UInt8)
|
||||
PRIMARY KEY some_name SOURCE(CLICKHOUSE(HOST 'localhost' PORT 9000
|
||||
PRIMARY KEY some_name SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort()
|
||||
TABLE dictst01747 DB currentDatabase() USER 'default'))
|
||||
LIFETIME(MIN 0 MAX 0) LAYOUT(COMPLEX_KEY_HASHED());
|
||||
|
||||
|
@ -228,13 +228,13 @@ function testMySQL()
|
||||
echo "MySQL 'successful login' case is skipped for ${auth_type}."
|
||||
else
|
||||
executeQuery \
|
||||
<<< "SELECT 1 FROM mysql('127.0.0.1:9004', 'system', 'one', '${username}', '${password}') LIMIT 1 \
|
||||
<<< "SELECT 1 FROM mysql('127.0.0.1:${CLICKHOUSE_PORT_MYSQL}', 'system', 'one', '${username}', '${password}') LIMIT 1 \
|
||||
FORMAT Null"
|
||||
fi
|
||||
|
||||
echo 'Wrong username'
|
||||
executeQueryExpectError \
|
||||
<<< "SELECT 1 FROM mysql('127.0.0.1:9004', 'system', 'one', 'invalid_${username}', '${password}') LIMIT 1 \
|
||||
<<< "SELECT 1 FROM mysql('127.0.0.1:${CLICKHOUSE_PORT_MYSQL}', 'system', 'one', 'invalid_${username}', '${password}') LIMIT 1 \
|
||||
FORMAT Null" \
|
||||
| grep -Eq "Code: 279\. DB::Exception: .* invalid_${username}"
|
||||
|
||||
@ -246,7 +246,7 @@ function testMySQL()
|
||||
echo "MySQL 'wrong password' case is skipped for ${auth_type}."
|
||||
else
|
||||
executeQueryExpectError \
|
||||
<<< "SELECT 1 FROM mysql('127.0.0.1:9004', 'system', 'one', '${username}', 'invalid_${password}') LIMIT 1 \
|
||||
<<< "SELECT 1 FROM mysql('127.0.0.1:${CLICKHOUSE_PORT_MYSQL}', 'system', 'one', '${username}', 'invalid_${password}') LIMIT 1 \
|
||||
FORMAT Null" | grep -Eq "Code: 279\. DB::Exception: .* ${username}"
|
||||
fi
|
||||
}
|
||||
@ -267,11 +267,11 @@ function testMySQL()
|
||||
## Loging\Logout
|
||||
## CH is being able to log into itself via PostgreSQL protocol but query fails.
|
||||
#executeQueryExpectError \
|
||||
# <<< "SELECT 1 FROM postgresql('localhost:9005', 'system', 'one', '${username}', '${password}') LIMIT 1 FORMAT Null" \
|
||||
# <<< "SELECT 1 FROM postgresql('localhost:${CLICKHOUSE_PORT_POSTGRESQL', 'system', 'one', '${username}', '${password}') LIMIT 1 FORMAT Null" \
|
||||
|
||||
# Wrong username
|
||||
executeQueryExpectError \
|
||||
<<< "SELECT 1 FROM postgresql('localhost:9005', 'system', 'one', 'invalid_${username}', '${password}') LIMIT 1 FORMAT Null" \
|
||||
<<< "SELECT 1 FROM postgresql('localhost:${CLICKHOUSE_PORT_POSTGRESQL}', 'system', 'one', 'invalid_${username}', '${password}') LIMIT 1 FORMAT Null" \
|
||||
| grep -Eq "Invalid user or password"
|
||||
|
||||
if [[ "${auth_type}" == "no_password" ]]
|
||||
@ -281,7 +281,7 @@ function testMySQL()
|
||||
else
|
||||
# Wrong password
|
||||
executeQueryExpectError \
|
||||
<<< "SELECT 1 FROM postgresql('localhost:9005', 'system', 'one', '${username}', 'invalid_${password}') LIMIT 1 FORMAT Null" \
|
||||
<<< "SELECT 1 FROM postgresql('localhost:${CLICKHOUSE_PORT_POSTGRESQL}', 'system', 'one', '${username}', 'invalid_${password}') LIMIT 1 FORMAT Null" \
|
||||
| grep -Eq "Invalid user or password"
|
||||
fi
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ CREATE DICTIONARY test_dict
|
||||
`value` String
|
||||
)
|
||||
PRIMARY KEY key1, key2
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT 9000 USER 'default' TABLE `test.txt` PASSWORD '' DB currentDatabase()))
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE `test.txt` PASSWORD '' DB currentDatabase()))
|
||||
LIFETIME(MIN 1 MAX 3600)
|
||||
LAYOUT(COMPLEX_KEY_HASHED());
|
||||
|
||||
|
@ -10,7 +10,7 @@ CREATE DICTIONARY dict1
|
||||
value String
|
||||
)
|
||||
PRIMARY KEY id
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT 9000 TABLE 'dict1'))
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() TABLE 'dict1'))
|
||||
LAYOUT(DIRECT());
|
||||
|
||||
SELECT * FROM dict1; --{serverError BAD_ARGUMENTS}
|
||||
@ -24,7 +24,7 @@ CREATE DICTIONARY 01780_db.dict2
|
||||
value String
|
||||
)
|
||||
PRIMARY KEY id
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT 9000 DATABASE '01780_db' TABLE 'dict2'))
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() DATABASE '01780_db' TABLE 'dict2'))
|
||||
LAYOUT(DIRECT());
|
||||
|
||||
SELECT * FROM 01780_db.dict2; --{serverError BAD_ARGUMENTS}
|
||||
@ -45,7 +45,7 @@ CREATE DICTIONARY 01780_db.dict3
|
||||
value String
|
||||
)
|
||||
PRIMARY KEY id
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT 9000 TABLE 'dict3_source' DATABASE '01780_db'))
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() TABLE 'dict3_source' DATABASE '01780_db'))
|
||||
LAYOUT(DIRECT());
|
||||
|
||||
SELECT * FROM 01780_db.dict3;
|
||||
|
@ -5,10 +5,9 @@ CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CUR_DIR"/../shell_config.sh
|
||||
|
||||
user_files_path=$($CLICKHOUSE_CLIENT_BINARY --query "select _path,_file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep Exception | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
||||
mkdir -p ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/
|
||||
rm -rf ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME:?}/*
|
||||
cp $CUR_DIR/data_json/btc_transactions.json ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/
|
||||
mkdir -p ${CLICKHOUSE_USER_FILES_UNIQUE}/
|
||||
rm -rf "${CLICKHOUSE_USER_FILES_UNIQUE:?}"/*
|
||||
cp $CUR_DIR/data_json/btc_transactions.json ${CLICKHOUSE_USER_FILES_UNIQUE}/
|
||||
|
||||
${CLICKHOUSE_CLIENT} -q "DROP TABLE IF EXISTS btc"
|
||||
|
||||
@ -27,4 +26,4 @@ ${CLICKHOUSE_CLIENT} -q "SELECT data.out.spending_outpoints AS outpoints FROM bt
|
||||
|
||||
${CLICKHOUSE_CLIENT} -q "DROP TABLE IF EXISTS btc"
|
||||
|
||||
rm ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/btc_transactions.json
|
||||
rm ${CLICKHOUSE_USER_FILES_UNIQUE}/btc_transactions.json
|
||||
|
@ -1,23 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: no-fasttest, no-parallel
|
||||
# Tags: no-fasttest
|
||||
|
||||
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CUR_DIR"/../shell_config.sh
|
||||
|
||||
user_files_path=$($CLICKHOUSE_CLIENT --query "select _path,_file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep -E '^Code: 107.*FILE_DOESNT_EXIST' | head -1 | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
||||
for f in "$user_files_path"/01825_file_*.json; do
|
||||
for f in "${USER_FILES_PATH:?}/${CLICKHOUSE_DATABASE}"_*.json; do
|
||||
[ -e $f ] && rm $f
|
||||
done
|
||||
|
||||
for i in {0..5}; do
|
||||
echo "{\"k$i\": 100}" > "$user_files_path"/01825_file_$i.json
|
||||
echo "{\"k$i\": 100}" > "$USER_FILES_PATH/${CLICKHOUSE_DATABASE}_$i.json"
|
||||
done
|
||||
|
||||
${CLICKHOUSE_CLIENT} -q "DROP TABLE IF EXISTS t_json_files"
|
||||
${CLICKHOUSE_CLIENT} -q "CREATE TABLE t_json_files (file String, data JSON) ENGINE = MergeTree ORDER BY tuple()" --allow_experimental_object_type 1
|
||||
|
||||
${CLICKHOUSE_CLIENT} -q "INSERT INTO t_json_files SELECT _file, data FROM file('01825_file_*.json', 'JSONAsObject', 'data JSON')" --allow_experimental_object_type 1
|
||||
${CLICKHOUSE_CLIENT} -q "INSERT INTO t_json_files SELECT _file, data FROM file('${CLICKHOUSE_DATABASE}_*.json', 'JSONAsObject', 'data JSON')" --allow_experimental_object_type 1
|
||||
|
||||
${CLICKHOUSE_CLIENT} -q "SELECT data FROM t_json_files ORDER BY file FORMAT JSONEachRow" --output_format_json_named_tuples_as_objects 1
|
||||
${CLICKHOUSE_CLIENT} -q "SELECT toTypeName(data) FROM t_json_files LIMIT 1"
|
||||
@ -25,7 +24,7 @@ ${CLICKHOUSE_CLIENT} -q "SELECT toTypeName(data) FROM t_json_files LIMIT 1"
|
||||
${CLICKHOUSE_CLIENT} -q "TRUNCATE TABLE IF EXISTS t_json_files"
|
||||
|
||||
${CLICKHOUSE_CLIENT} -q "INSERT INTO t_json_files \
|
||||
SELECT _file, data FROM file('01825_file_*.json', 'JSONAsObject', 'data JSON') \
|
||||
SELECT _file, data FROM file('${CLICKHOUSE_DATABASE}_*.json', 'JSONAsObject', 'data JSON') \
|
||||
ORDER BY _file LIMIT 3" --max_threads 1 --min_insert_block_size_rows 1 --max_insert_block_size 1 --max_block_size 1 --allow_experimental_object_type 1
|
||||
|
||||
${CLICKHOUSE_CLIENT} -q "SELECT data FROM t_json_files ORDER BY file, data FORMAT JSONEachRow" --output_format_json_named_tuples_as_objects 1
|
||||
@ -34,11 +33,11 @@ ${CLICKHOUSE_CLIENT} -q "SELECT toTypeName(data) FROM t_json_files LIMIT 1"
|
||||
${CLICKHOUSE_CLIENT} -q "TRUNCATE TABLE IF EXISTS t_json_files"
|
||||
|
||||
${CLICKHOUSE_CLIENT} -q "INSERT INTO t_json_files \
|
||||
SELECT _file, data FROM file('01825_file_*.json', 'JSONAsObject', 'data JSON') \
|
||||
WHERE _file IN ('01825_file_1.json', '01825_file_3.json')" --allow_experimental_object_type 1
|
||||
SELECT _file, data FROM file('${CLICKHOUSE_DATABASE}_*.json', 'JSONAsObject', 'data JSON') \
|
||||
WHERE _file IN ('${CLICKHOUSE_DATABASE}_1.json', '${CLICKHOUSE_DATABASE}_3.json')" --allow_experimental_object_type 1
|
||||
|
||||
${CLICKHOUSE_CLIENT} -q "SELECT data FROM t_json_files ORDER BY file FORMAT JSONEachRow" --output_format_json_named_tuples_as_objects 1
|
||||
${CLICKHOUSE_CLIENT} -q "SELECT toTypeName(data) FROM t_json_files LIMIT 1"
|
||||
|
||||
${CLICKHOUSE_CLIENT} -q "DROP TABLE IF EXISTS t_json_files"
|
||||
rm "$user_files_path"/01825_file_*.json
|
||||
rm "$USER_FILES_PATH"/${CLICKHOUSE_DATABASE}_*.json
|
||||
|
@ -10,11 +10,10 @@ ${CLICKHOUSE_CLIENT} -q "DROP TABLE IF EXISTS t_json_inference"
|
||||
${CLICKHOUSE_CLIENT} -q "CREATE TABLE t_json_inference (id UInt64, obj Object(Nullable('json')), s String) \
|
||||
ENGINE = MergeTree ORDER BY id" --allow_experimental_object_type 1
|
||||
|
||||
user_files_path=$($CLICKHOUSE_CLIENT_BINARY --query "select _path,_file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep Exception | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
||||
mkdir -p ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/
|
||||
rm -rf ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME:?}/*
|
||||
mkdir -p ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/
|
||||
rm -rf ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME:?}/*
|
||||
|
||||
filename="${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/data.json"
|
||||
filename="${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/data.json"
|
||||
|
||||
echo '{"id": 1, "obj": {"k1": 1, "k2": {"k3": 2, "k4": [{"k5": 3}, {"k5": 4}]}}, "s": "foo"}' > $filename
|
||||
echo '{"id": 2, "obj": {"k2": {"k3": "str", "k4": [{"k6": 55}]}, "some": 42}, "s": "bar"}' >> $filename
|
||||
|
@ -5,8 +5,6 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
USER_FILES_PATH=$($CLICKHOUSE_CLIENT_BINARY --query "select _path,_file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep Exception | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
||||
|
||||
$CLICKHOUSE_CLIENT -n --query="
|
||||
SET allow_experimental_bigint_types = 1;
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: no-parallel
|
||||
|
||||
CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL=none
|
||||
|
||||
@ -7,23 +6,27 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
${CLICKHOUSE_CLIENT} -q "drop user if exists u_01889"
|
||||
${CLICKHOUSE_CLIENT} -q "drop role if exists r_01889"
|
||||
${CLICKHOUSE_CLIENT} -q "drop policy if exists t_01889_filter on t_01889"
|
||||
${CLICKHOUSE_CLIENT} -q "create user u_01889 identified with plaintext_password by 'dfsdffdf5t123'"
|
||||
${CLICKHOUSE_CLIENT} -q "revoke all on *.* from u_01889"
|
||||
${CLICKHOUSE_CLIENT} -q "create role r_01889"
|
||||
USER=u_01889$RANDOM
|
||||
ROLE=r_01889$RANDOM
|
||||
POLICY=t_01889_filter$RANDOM
|
||||
|
||||
${CLICKHOUSE_CLIENT} -q "drop user if exists $USER"
|
||||
${CLICKHOUSE_CLIENT} -q "drop role if exists ${ROLE}"
|
||||
${CLICKHOUSE_CLIENT} -q "drop policy if exists ${POLICY} on t_01889"
|
||||
${CLICKHOUSE_CLIENT} -q "create user $USER identified with plaintext_password by 'dfsdffdf5t123'"
|
||||
${CLICKHOUSE_CLIENT} -q "revoke all on *.* from $USER"
|
||||
${CLICKHOUSE_CLIENT} -q "create role ${ROLE}"
|
||||
${CLICKHOUSE_CLIENT} -q "create table t_01889(a Int64, user_id String) Engine=MergeTree order by a"
|
||||
${CLICKHOUSE_CLIENT} -q "insert into t_01889 select number, 'u_01889' from numbers(1000)"
|
||||
${CLICKHOUSE_CLIENT} -q "insert into t_01889 select number, '$USER' from numbers(1000)"
|
||||
${CLICKHOUSE_CLIENT} -q "insert into t_01889 select number, 'xxxxxxx' from numbers(1000)"
|
||||
${CLICKHOUSE_CLIENT} -q "grant select on t_01889 to r_01889"
|
||||
${CLICKHOUSE_CLIENT} -q "create row policy t_01889_filter ON t_01889 FOR SELECT USING user_id = user() TO r_01889"
|
||||
${CLICKHOUSE_CLIENT} -q "grant r_01889 to u_01889"
|
||||
${CLICKHOUSE_CLIENT} -q "alter user u_01889 default role r_01889 settings none"
|
||||
${CLICKHOUSE_CLIENT} -q "grant select on t_01889 to ${ROLE}"
|
||||
${CLICKHOUSE_CLIENT} -q "create row policy ${POLICY} ON t_01889 FOR SELECT USING user_id = user() TO ${ROLE}"
|
||||
${CLICKHOUSE_CLIENT} -q "grant ${ROLE} to $USER"
|
||||
${CLICKHOUSE_CLIENT} -q "alter user $USER default role ${ROLE} settings none"
|
||||
|
||||
${CLICKHOUSE_CLIENT_BINARY} --database=${CLICKHOUSE_DATABASE} --user=u_01889 --password=dfsdffdf5t123 --query="select count() from t_01889"
|
||||
${CLICKHOUSE_CLIENT_BINARY} --database=${CLICKHOUSE_DATABASE} --user=$USER --password=dfsdffdf5t123 --query="select count() from t_01889"
|
||||
|
||||
${CLICKHOUSE_CLIENT} -q "drop user u_01889"
|
||||
${CLICKHOUSE_CLIENT} -q "drop policy t_01889_filter on t_01889"
|
||||
${CLICKHOUSE_CLIENT} -q "drop role r_01889"
|
||||
${CLICKHOUSE_CLIENT} -q "drop user $USER"
|
||||
${CLICKHOUSE_CLIENT} -q "drop policy ${POLICY} on t_01889"
|
||||
${CLICKHOUSE_CLIENT} -q "drop role ${ROLE}"
|
||||
${CLICKHOUSE_CLIENT} -q "drop table t_01889"
|
||||
|
@ -6,15 +6,9 @@ CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CUR_DIR"/../shell_config.sh
|
||||
|
||||
# See 01658_read_file_to_string_column.sh
|
||||
user_files_path=$($CLICKHOUSE_CLIENT_BINARY --query "select _path,_file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep Exception | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
||||
|
||||
mkdir -p "${user_files_path}/"
|
||||
chmod 777 "${user_files_path}"
|
||||
|
||||
export CURR_DATABASE="test_01889_sqllite_${CLICKHOUSE_DATABASE}"
|
||||
|
||||
DB_PATH=${user_files_path}/${CURR_DATABASE}_db1
|
||||
DB_PATH=${USER_FILES_PATH}/${CURR_DATABASE}_db1
|
||||
DB_PATH2=$CUR_DIR/${CURR_DATABASE}_db2
|
||||
|
||||
function cleanup()
|
||||
|
@ -5,8 +5,6 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
USER_FILES_PATH=$($CLICKHOUSE_CLIENT_BINARY --query "select _path,_file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep Exception | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
||||
|
||||
$CLICKHOUSE_CLIENT -n --query="
|
||||
DROP TABLE IF EXISTS dictionary_array_source_table;
|
||||
CREATE TABLE dictionary_array_source_table
|
||||
|
@ -5,8 +5,6 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
USER_FILES_PATH=$($CLICKHOUSE_CLIENT_BINARY --query "select _path,_file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep Exception | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
||||
|
||||
$CLICKHOUSE_CLIENT -n --query="
|
||||
DROP TABLE IF EXISTS dictionary_nullable_source_table;
|
||||
CREATE TABLE dictionary_nullable_source_table
|
||||
|
@ -34,7 +34,7 @@ CREATE DICTIONARY flat_dictionary
|
||||
value_ru String
|
||||
)
|
||||
PRIMARY KEY id
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT 9000 USER 'default' PASSWORD '' TABLE 'dictionary_source_view'))
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' PASSWORD '' TABLE 'dictionary_source_view'))
|
||||
LIFETIME(MIN 1 MAX 1000)
|
||||
LAYOUT(FLAT());
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: long, zookeeper, no-parallel
|
||||
# Tags: long, zookeeper
|
||||
|
||||
CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL=error
|
||||
|
||||
@ -50,7 +50,7 @@ function insert_thread
|
||||
export -f insert_thread;
|
||||
export -f optimize_thread;
|
||||
|
||||
TIMEOUT=30
|
||||
TIMEOUT=20
|
||||
|
||||
timeout $TIMEOUT bash -c insert_thread 2> /dev/null &
|
||||
timeout $TIMEOUT bash -c insert_thread 2> /dev/null &
|
||||
|
@ -6,10 +6,8 @@ CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
. "$CUR_DIR"/../shell_config.sh
|
||||
|
||||
|
||||
# See 01658_read_file_to_string_column.sh
|
||||
user_files_path=$($CLICKHOUSE_CLIENT_BINARY --query "select _path,_file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep Exception | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
||||
mkdir -p ${user_files_path}/
|
||||
cp $CUR_DIR/data_zstd/test_01946.zstd ${user_files_path}/
|
||||
mkdir -p ${USER_FILES_PATH}/
|
||||
cp $CUR_DIR/data_zstd/test_01946.zstd ${USER_FILES_PATH}/
|
||||
|
||||
${CLICKHOUSE_CLIENT} --multiline --multiquery --query "
|
||||
set min_chunk_bytes_for_parallel_parsing=10485760;
|
||||
|
@ -6,7 +6,6 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
USER_FILES_PATH=$($CLICKHOUSE_CLIENT_BINARY --query "select _path,_file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep Exception | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
||||
WORKING_FOLDER_02003="${USER_FILES_PATH}/${CLICKHOUSE_DATABASE}"
|
||||
|
||||
rm -rf "${WORKING_FOLDER_02003}"
|
||||
|
@ -4,7 +4,6 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
USER_FILES_PATH=$($CLICKHOUSE_CLIENT_BINARY --query "select _path,_file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep Exception | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
||||
WORKING_FOLDER_02012="${USER_FILES_PATH}/${CLICKHOUSE_DATABASE}"
|
||||
|
||||
rm -rf "${WORKING_FOLDER_02012}"
|
||||
|
@ -6,30 +6,26 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
# Data preparation.
|
||||
# Now we can get the user_files_path by use the table file function for trick. also we can get it by query as:
|
||||
# "insert into function file('exist.txt', 'CSV', 'val1 char') values ('aaaa'); select _path from file('exist.txt', 'CSV', 'val1 char')"
|
||||
user_files_path=$($CLICKHOUSE_CLIENT_BINARY --query "select _path,_file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep Exception | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
||||
|
||||
for i in {1..20}
|
||||
do
|
||||
echo $i, $i >> ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}.txt
|
||||
echo $i, $i >> ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}.txt
|
||||
done
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "drop table if exists file_log;"
|
||||
${CLICKHOUSE_CLIENT} --query "create table file_log(k UInt8, v UInt8) engine=FileLog('${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}.txt', 'CSV');"
|
||||
${CLICKHOUSE_CLIENT} --query "create table file_log(k UInt8, v UInt8) engine=FileLog('${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}.txt', 'CSV');"
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "select * from file_log order by k settings stream_like_engine_allow_direct_select=1;"
|
||||
|
||||
for i in {100..120}
|
||||
do
|
||||
echo $i, $i >> ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}.txt
|
||||
echo $i, $i >> ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}.txt
|
||||
done
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "select * from file_log order by k settings stream_like_engine_allow_direct_select=1;"
|
||||
|
||||
# touch does not change file content, no event
|
||||
touch ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}.txt
|
||||
touch ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}.txt
|
||||
${CLICKHOUSE_CLIENT} --query "select * from file_log order by k settings stream_like_engine_allow_direct_select=1;"
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "detach table file_log;"
|
||||
@ -40,4 +36,4 @@ ${CLICKHOUSE_CLIENT} --query "select * from file_log order by k settings stream_
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "drop table file_log;"
|
||||
|
||||
rm -rf ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}.txt
|
||||
rm -rf ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}.txt
|
||||
|
@ -6,57 +6,52 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
# Data preparation.
|
||||
# Now we can get the user_files_path by use the table file function for trick. also we can get it by query as:
|
||||
# "insert into function file('exist.txt', 'CSV', 'val1 char') values ('aaaa'); select _path from file('exist.txt', 'CSV', 'val1 char')"
|
||||
user_files_path=$($CLICKHOUSE_CLIENT_BINARY --query "select _path,_file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep Exception | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
||||
mkdir -p ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/
|
||||
|
||||
mkdir -p ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/
|
||||
|
||||
rm -rf ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME:?}/*
|
||||
rm -rf ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME:?}/*
|
||||
|
||||
for i in {1..20}
|
||||
do
|
||||
echo $i, $i >> ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt
|
||||
echo $i, $i >> ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt
|
||||
done
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "drop table if exists file_log;"
|
||||
${CLICKHOUSE_CLIENT} --query "create table file_log(k UInt8, v UInt8) engine=FileLog('${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/', 'CSV');"
|
||||
${CLICKHOUSE_CLIENT} --query "create table file_log(k UInt8, v UInt8) engine=FileLog('${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/', 'CSV');"
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "select * from file_log order by k settings stream_like_engine_allow_direct_select=1;"
|
||||
|
||||
cp ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/b.txt
|
||||
cp ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/b.txt
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "select * from file_log order by k settings stream_like_engine_allow_direct_select=1;"
|
||||
|
||||
for i in {100..120}
|
||||
do
|
||||
echo $i, $i >> ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt
|
||||
echo $i, $i >> ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt
|
||||
done
|
||||
|
||||
# touch does not change file content, no event
|
||||
touch ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt
|
||||
touch ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt
|
||||
|
||||
cp ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/c.txt
|
||||
cp ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/d.txt
|
||||
cp ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/e.txt
|
||||
mv ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/b.txt ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/j.txt
|
||||
cp ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/c.txt
|
||||
cp ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/d.txt
|
||||
cp ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/e.txt
|
||||
mv ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/b.txt ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/j.txt
|
||||
|
||||
rm ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/d.txt
|
||||
rm ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/d.txt
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "select * from file_log order by k settings stream_like_engine_allow_direct_select=1;"
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "detach table file_log;"
|
||||
cp ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/e.txt ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/f.txt
|
||||
mv ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/e.txt ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/g.txt
|
||||
mv ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/c.txt ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/h.txt
|
||||
cp ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/e.txt ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/f.txt
|
||||
mv ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/e.txt ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/g.txt
|
||||
mv ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/c.txt ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/h.txt
|
||||
for i in {150..200}
|
||||
do
|
||||
echo $i, $i >> ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/h.txt
|
||||
echo $i, $i >> ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/h.txt
|
||||
done
|
||||
for i in {200..250}
|
||||
do
|
||||
echo $i, $i >> ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/i.txt
|
||||
echo $i, $i >> ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/i.txt
|
||||
done
|
||||
${CLICKHOUSE_CLIENT} --query "attach table file_log;"
|
||||
|
||||
@ -68,11 +63,11 @@ ${CLICKHOUSE_CLIENT} --query "attach table file_log;"
|
||||
# should no records return
|
||||
${CLICKHOUSE_CLIENT} --query "select * from file_log order by k settings stream_like_engine_allow_direct_select=1;"
|
||||
|
||||
truncate ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt --size 0
|
||||
truncate ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt --size 0
|
||||
|
||||
# exception happend
|
||||
${CLICKHOUSE_CLIENT} --query "select * from file_log order by k settings stream_like_engine_allow_direct_select=1;" 2>&1 | grep -q "Code: 33" && echo 'OK' || echo 'FAIL'
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "drop table file_log;"
|
||||
|
||||
rm -rf ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME:?}
|
||||
rm -rf ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME:?}
|
||||
|
@ -7,21 +7,16 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
# Data preparation.
|
||||
# Now we can get the user_files_path by use the table file function for trick. also we can get it by query as:
|
||||
# "insert into function file('exist.txt', 'CSV', 'val1 char') values ('aaaa'); select _path from file('exist.txt', 'CSV', 'val1 char')"
|
||||
user_files_path=$($CLICKHOUSE_CLIENT_BINARY --query "select _path,_file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep Exception | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
||||
|
||||
mkdir -p ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/
|
||||
rm -rf ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME:?}/*
|
||||
mkdir -p ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/
|
||||
rm -rf ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME:?}/*
|
||||
|
||||
for i in {1..20}
|
||||
do
|
||||
echo $i, $i >> ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt
|
||||
echo $i, $i >> ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt
|
||||
done
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "drop table if exists file_log;"
|
||||
${CLICKHOUSE_CLIENT} --query "create table file_log(k UInt8, v UInt8) engine=FileLog('${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/', 'CSV');"
|
||||
${CLICKHOUSE_CLIENT} --query "create table file_log(k UInt8, v UInt8) engine=FileLog('${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/', 'CSV');"
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "drop table if exists mv;"
|
||||
${CLICKHOUSE_CLIENT} --query "create Materialized View mv engine=MergeTree order by k as select * from file_log;"
|
||||
@ -39,17 +34,17 @@ done
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "select * from mv order by k;"
|
||||
|
||||
cp ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/b.txt
|
||||
cp ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/b.txt
|
||||
|
||||
# touch does not change file content, no event
|
||||
touch ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt
|
||||
touch ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt
|
||||
|
||||
cp ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/c.txt
|
||||
cp ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/d.txt
|
||||
cp ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/c.txt
|
||||
cp ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/d.txt
|
||||
|
||||
for i in {100..120}
|
||||
do
|
||||
echo $i, $i >> ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/d.txt
|
||||
echo $i, $i >> ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/d.txt
|
||||
done
|
||||
|
||||
while true; do
|
||||
@ -62,4 +57,4 @@ ${CLICKHOUSE_CLIENT} --query "select * from mv order by k;"
|
||||
${CLICKHOUSE_CLIENT} --query "drop table mv;"
|
||||
${CLICKHOUSE_CLIENT} --query "drop table file_log;"
|
||||
|
||||
rm -rf ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME:?}
|
||||
rm -rf ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME:?}
|
||||
|
@ -6,42 +6,37 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
# Data preparation.
|
||||
# Now we can get the user_files_path by use the table file function for trick. also we can get it by query as:
|
||||
# "insert into function file('exist.txt', 'CSV', 'val1 char') values ('aaaa'); select _path from file('exist.txt', 'CSV', 'val1 char')"
|
||||
user_files_path=$($CLICKHOUSE_CLIENT_BINARY --query "select _path,_file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep Exception | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
||||
mkdir -p ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/
|
||||
|
||||
mkdir -p ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/
|
||||
|
||||
rm -rf ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME:?}/*
|
||||
rm -rf ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME:?}/*
|
||||
|
||||
for i in {1..20}
|
||||
do
|
||||
echo $i, $i >> ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt
|
||||
echo $i, $i >> ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt
|
||||
done
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "drop table if exists file_log;"
|
||||
${CLICKHOUSE_CLIENT} --query "create table file_log(k UInt8, v UInt8) engine=FileLog('${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/', 'CSV');"
|
||||
${CLICKHOUSE_CLIENT} --query "create table file_log(k UInt8, v UInt8) engine=FileLog('${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/', 'CSV');"
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "select *, _filename, _offset from file_log order by _filename, _offset settings stream_like_engine_allow_direct_select=1;"
|
||||
|
||||
cp ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/b.txt
|
||||
cp ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/b.txt
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "select *, _filename, _offset from file_log order by _filename, _offset settings stream_like_engine_allow_direct_select=1;"
|
||||
|
||||
for i in {100..120}
|
||||
do
|
||||
echo $i, $i >> ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt
|
||||
echo $i, $i >> ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt
|
||||
done
|
||||
|
||||
# touch does not change file content, no event
|
||||
touch ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt
|
||||
touch ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt
|
||||
|
||||
cp ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/c.txt
|
||||
cp ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/d.txt
|
||||
cp ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/e.txt
|
||||
cp ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/c.txt
|
||||
cp ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/d.txt
|
||||
cp ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/e.txt
|
||||
|
||||
rm ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/d.txt
|
||||
rm ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/d.txt
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "select *, _filename, _offset from file_log order by _filename, _offset settings stream_like_engine_allow_direct_select=1;"
|
||||
|
||||
@ -51,11 +46,11 @@ ${CLICKHOUSE_CLIENT} --query "attach table file_log;"
|
||||
# should no records return
|
||||
${CLICKHOUSE_CLIENT} --query "select *, _filename, _offset from file_log order by _filename, _offset settings stream_like_engine_allow_direct_select=1;"
|
||||
|
||||
truncate ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt --size 0
|
||||
truncate ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/a.txt --size 0
|
||||
|
||||
# exception happend
|
||||
${CLICKHOUSE_CLIENT} --query "select * from file_log order by k settings stream_like_engine_allow_direct_select=1;" 2>&1 | grep -q "Code: 33" && echo 'OK' || echo 'FAIL'
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "drop table file_log;"
|
||||
|
||||
rm -rf ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME:?}
|
||||
rm -rf ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME:?}
|
||||
|
@ -7,34 +7,27 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
# Data preparation.
|
||||
# Now we can get the user_files_path by use the table file function for trick. also we can get it by query as:
|
||||
# "insert into function file('exist.txt', 'CSV', 'val1 char') values ('aaaa'); select _path from file('exist.txt', 'CSV', 'val1 char')"
|
||||
user_files_path=$($CLICKHOUSE_CLIENT_BINARY --query "select _path,_file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep Exception | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
||||
|
||||
mkdir -p ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/
|
||||
|
||||
rm -rf ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME:?}/*
|
||||
|
||||
chmod 777 ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/
|
||||
mkdir -p ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/
|
||||
rm -rf ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME:?}/*
|
||||
chmod 777 ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/
|
||||
|
||||
for i in {1..10}
|
||||
do
|
||||
${CLICKHOUSE_CLIENT} --query "insert into function file('${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/test$i.csv', 'CSV', 'k UInt32, v UInt32') select number, number from numbers(10000);"
|
||||
${CLICKHOUSE_CLIENT} --query "insert into function file('${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/test$i.csv', 'CSV', 'k UInt32, v UInt32') select number, number from numbers(10000);"
|
||||
done
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "drop table if exists file_log;"
|
||||
${CLICKHOUSE_CLIENT} --query "create table file_log(k UInt32, v UInt32) engine=FileLog('${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/', 'CSV');"
|
||||
${CLICKHOUSE_CLIENT} --query "create table file_log(k UInt32, v UInt32) engine=FileLog('${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/', 'CSV');"
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "select count() from file_log settings stream_like_engine_allow_direct_select=1;"
|
||||
|
||||
for i in {11..20}
|
||||
do
|
||||
${CLICKHOUSE_CLIENT} --query "insert into function file('${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME}/test$i.csv', 'CSV', 'k UInt32, v UInt32') select number, number from numbers(10000);"
|
||||
${CLICKHOUSE_CLIENT} --query "insert into function file('${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME}/test$i.csv', 'CSV', 'k UInt32, v UInt32') select number, number from numbers(10000);"
|
||||
done
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "select count() from file_log settings stream_like_engine_allow_direct_select=1;"
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "drop table file_log;"
|
||||
|
||||
rm -rf ${user_files_path}/${CLICKHOUSE_TEST_UNIQUE_NAME:?}
|
||||
rm -rf ${USER_FILES_PATH}/${CLICKHOUSE_TEST_UNIQUE_NAME:?}
|
||||
|
@ -1,17 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: no-fasttest, no-parallel, no-replicated-database
|
||||
# Tags: no-fasttest, no-replicated-database
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
USER_FILES_PATH=$($CLICKHOUSE_CLIENT_BINARY --query "select _path,_file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep Exception | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
||||
CAPN_PROTO_FILE=$USER_FILES_PATH/data.capnp
|
||||
touch $CAPN_PROTO_FILE
|
||||
|
||||
SCHEMADIR=$($CLICKHOUSE_CLIENT_BINARY --query "select * from file('data.capnp', 'CapnProto', 'val1 char') settings format_schema='nonexist:Message'" 2>&1 | grep Exception | grep -oP "file \K.*(?=/nonexist.capnp)")
|
||||
SCHEMADIR=${CLICKHOUSE_SCHEMA_FILES}
|
||||
CLIENT_SCHEMADIR=$CURDIR/format_schemas
|
||||
SERVER_SCHEMADIR=test_02030
|
||||
SERVER_SCHEMADIR=${CLICKHOUSE_DATABASE}
|
||||
mkdir -p $SCHEMADIR/$SERVER_SCHEMADIR
|
||||
cp -r $CLIENT_SCHEMADIR/02030_* $SCHEMADIR/$SERVER_SCHEMADIR/
|
||||
|
||||
|
@ -5,10 +5,7 @@ CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CUR_DIR"/../shell_config.sh
|
||||
|
||||
# See 01658_read_file_to_string_column.sh
|
||||
user_files_path=$($CLICKHOUSE_CLIENT_BINARY --query "select _path,_file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep Exception | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
||||
|
||||
FILE_PATH="${user_files_path}/file"
|
||||
FILE_PATH="${USER_FILES_PATH}/file"
|
||||
mkdir -p ${FILE_PATH}
|
||||
chmod 777 ${FILE_PATH}
|
||||
|
||||
|
@ -5,7 +5,7 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
DATA_FILE=$CLICKHOUSE_TMP/test_02103_null.data
|
||||
DATA_FILE=${CLICKHOUSE_TMP}/${CLICKHOUSE_DATABASE}_null.data
|
||||
|
||||
# Wrapper for clickhouse-client to always output in JSONEachRow format, that
|
||||
# way format settings will not affect output.
|
||||
|
@ -1,20 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: no-parallel
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
USER_FILES_PATH=$(clickhouse client --query "select _path,_file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep Exception | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
||||
|
||||
DATA_FILE=$USER_FILES_PATH/test_02103.data
|
||||
DATA_FILE=$USER_FILES_PATH/${CLICKHOUSE_DATABASE}.data
|
||||
|
||||
FORMATS=('TSVWithNames' 'TSVWithNamesAndTypes' 'TSVRawWithNames' 'TSVRawWithNamesAndTypes' 'CSVWithNames' 'CSVWithNamesAndTypes' 'JSONCompactEachRowWithNames' 'JSONCompactEachRowWithNamesAndTypes')
|
||||
|
||||
for format in "${FORMATS[@]}"
|
||||
do
|
||||
$CLICKHOUSE_CLIENT -q "SELECT number, range(number + 10) AS array, toString(number) AS string FROM numbers(10) FORMAT $format" > $DATA_FILE
|
||||
$CLICKHOUSE_CLIENT -q "SELECT * FROM file('test_02103.data', '$format', 'number UInt64, array Array(UInt64), string String') ORDER BY number SETTINGS input_format_parallel_parsing=1, min_chunk_bytes_for_parallel_parsing=40"
|
||||
$CLICKHOUSE_CLIENT -q "SELECT * FROM file('${CLICKHOUSE_DATABASE}.data', '$format', 'number UInt64, array Array(UInt64), string String') ORDER BY number SETTINGS input_format_parallel_parsing=1, min_chunk_bytes_for_parallel_parsing=40"
|
||||
done
|
||||
|
||||
rm $DATA_FILE
|
||||
|
@ -5,7 +5,6 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
USER_FILES_PATH=$($CLICKHOUSE_CLIENT_BINARY --query "select _path,_file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep Exception | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
||||
DATA_FILE=$USER_FILES_PATH/test_02104_null.data
|
||||
|
||||
echo -e '{"s" : "NULLSome string"}' > $DATA_FILE
|
||||
|
@ -5,13 +5,7 @@ CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CUR_DIR"/../shell_config.sh
|
||||
|
||||
# See 01658_read_file_to_string_column.sh
|
||||
user_files_path=$($CLICKHOUSE_CLIENT_BINARY --query "select _path,_file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep Exception | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
||||
|
||||
mkdir -p "${user_files_path}/"
|
||||
chmod 777 ${user_files_path}
|
||||
|
||||
FILE_PATH="${user_files_path}/test_table_function_file"
|
||||
FILE_PATH="${USER_FILES_PATH}/test_table_function_file"
|
||||
|
||||
function cleanup()
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: no-fasttest, no-parallel
|
||||
# Tags: no-fasttest
|
||||
# Tag no-fasttest: depends on brotli and bzip2
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
|
@ -1,5 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: no-parallel
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user