add some tests

This commit is contained in:
CurtizJ 2020-01-21 14:56:46 +03:00
parent 6a29525fa3
commit 13709875ea
4 changed files with 33 additions and 0 deletions

View 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 }

View File

@ -0,0 +1,2 @@
100
1 9

View File

@ -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;