mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
make test more stable
This commit is contained in:
parent
a058f3a301
commit
a01f824789
31
dbms/tests/queries/0_stateless/01055_compact_parts_granularity.sh
Executable file
31
dbms/tests/queries/0_stateless/01055_compact_parts_granularity.sh
Executable file
@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
. $CURDIR/../shell_config.sh
|
||||
|
||||
$CLICKHOUSE_CLIENT -q "DROP TABLE IF EXISTS mt_compact"
|
||||
|
||||
# Checks that granularity correctly computed from small parts.
|
||||
|
||||
$CLICKHOUSE_CLIENT -q "CREATE TABLE mt_compact(a Int, s String) ENGINE = MergeTree ORDER BY a
|
||||
SETTINGS min_rows_for_wide_part = 1000,
|
||||
index_granularity = 14;"
|
||||
|
||||
$CLICKHOUSE_CLIENT -q "SYSTEM STOP MERGES mt_compact"
|
||||
|
||||
$CLICKHOUSE_CLIENT --max_block_size=1 --min_insert_block_size_rows=1 -q \
|
||||
"INSERT INTO mt_compact SELECT number, 'aaa' FROM numbers(100);"
|
||||
|
||||
$CLICKHOUSE_CLIENT -q "SELECT count() FROM system.parts WHERE table = 'mt_compact' AND database = currentDatabase() AND active"
|
||||
$CLICKHOUSE_CLIENT -q "SYSTEM START MERGES mt_compact"
|
||||
|
||||
# Retry because already started concurrent merges may interrupt optimize
|
||||
for i in {0..10}; do
|
||||
$CLICKHOUSE_CLIENT -q "OPTIMIZE TABLE mt_compact FINAL SETTINGS optimize_throw_if_noop=1" 2>/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
$CLICKHOUSE_CLIENT -q "SELECT count(), sum(marks) FROM system.parts WHERE table = 'mt_compact' AND database = currentDatabase() AND active"
|
||||
$CLICKHOUSE_CLIENT -q "DROP TABLE mt_compact"
|
@ -1,21 +0,0 @@
|
||||
drop table if exists mt_compact;
|
||||
|
||||
-- Checks that granularity correctly computed from small parts.
|
||||
|
||||
create table mt_compact(a Int, s String) engine = MergeTree order by a
|
||||
settings min_rows_for_wide_part = 1000,
|
||||
index_granularity = 14;
|
||||
|
||||
system stop merges mt_compact;
|
||||
set max_block_size = 1;
|
||||
set min_insert_block_size_rows=1;
|
||||
insert into mt_compact select number, 'aaa' from numbers(100);
|
||||
|
||||
select count() from system.parts where table = 'mt_compact' and database = currentDatabase() and active;
|
||||
|
||||
system start merges mt_compact;
|
||||
optimize table mt_compact final;
|
||||
|
||||
select count(), sum(marks) from system.parts where table = 'mt_compact' and database = currentDatabase() and active;
|
||||
|
||||
drop table mt_compact;
|
Loading…
Reference in New Issue
Block a user