mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
add some tests
This commit is contained in:
parent
6a29525fa3
commit
13709875ea
10
dbms/tests/queries/0_stateless/01055_compact_parts_1.sql
Normal file
10
dbms/tests/queries/0_stateless/01055_compact_parts_1.sql
Normal file
@ -0,0 +1,10 @@
|
||||
drop table if exists mt_compact;
|
||||
|
||||
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 48 }
|
||||
|
||||
create table mt_compact_2 (a Int, s String) engine = MergeTree order by a partition by a
|
||||
settings min_rows_for_wide_part = 1000;
|
||||
insert into mt_compact_2 values (1, 'a');
|
||||
alter table mt_compact attach partition 1 from mt_compact_2; -- { serverError 36 }
|
@ -0,0 +1,2 @@
|
||||
100
|
||||
1 9
|
@ -0,0 +1,21 @@
|
||||
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