test for attach partition from. #17500

This commit is contained in:
Denis Zhuravlev 2021-06-07 18:30:03 -03:00
parent 23bf4cf09f
commit 944940d6fb
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,4 @@
1
1
2
2

View File

@ -0,0 +1,27 @@
DROP TABLE IF EXISTS test_alter_attach_01901S;
DROP TABLE IF EXISTS test_alter_attach_01901D;
CREATE TABLE test_alter_attach_01901S (A Int64, D date) ENGINE = MergeTree partition by D order by A;
insert into test_alter_attach_01901S values(1, '2020-01-01');
create table test_alter_attach_01901D (A Int64, D date)
Engine=ReplicatedMergeTree('/clickhouse/tables/test_alter_attach_01901D', 'r1')
partition by D order by A;
alter table test_alter_attach_01901D attach partition '2020-01-01' from test_alter_attach_01901S;
select count() from test_alter_attach_01901D;
select count() from test_alter_attach_01901S;
insert into test_alter_attach_01901S values(1, '2020-01-01');
alter table test_alter_attach_01901D replace partition '2020-01-01' from test_alter_attach_01901S;
select count() from test_alter_attach_01901D;
select count() from test_alter_attach_01901S;
DROP TABLE test_alter_attach_01901S;
DROP TABLE test_alter_attach_01901D;