mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-03 13:02:00 +00:00
test for attach partition from. #17500
This commit is contained in:
parent
23bf4cf09f
commit
944940d6fb
@ -0,0 +1,4 @@
|
||||
1
|
||||
1
|
||||
2
|
||||
2
|
@ -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;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user