mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
32 lines
1.3 KiB
SQL
32 lines
1.3 KiB
SQL
drop table if exists ttl_test_02129;
|
|
|
|
create table ttl_test_02129(a Int64, b String, d Date)
|
|
Engine=MergeTree partition by d order by a
|
|
settings min_bytes_for_wide_part = 0, min_rows_for_wide_part = 0, materialize_ttl_recalculate_only = 0;
|
|
|
|
insert into ttl_test_02129 select number, '', '2021-01-01' from numbers(10);
|
|
alter table ttl_test_02129 add column c Int64 settings mutations_sync=2;
|
|
|
|
insert into ttl_test_02129 select number, '', '2021-01-01', 0 from numbers(10);
|
|
alter table ttl_test_02129 modify TTL (d + INTERVAL 1 MONTH) DELETE WHERE c=1 settings mutations_sync=2;
|
|
|
|
select * from ttl_test_02129 order by a, b, d, c;
|
|
drop table ttl_test_02129;
|
|
|
|
drop table if exists ttl_test_02129;
|
|
|
|
select '==========';
|
|
|
|
create table ttl_test_02129(a Int64, b String, d Date)
|
|
Engine=MergeTree partition by d order by a
|
|
settings min_bytes_for_wide_part = 0, min_rows_for_wide_part = 0, materialize_ttl_recalculate_only = 1;
|
|
|
|
insert into ttl_test_02129 select number, '', '2021-01-01' from numbers(10);
|
|
alter table ttl_test_02129 add column c Int64 settings mutations_sync=2;
|
|
|
|
insert into ttl_test_02129 select number, '', '2021-01-01', 0 from numbers(10);
|
|
alter table ttl_test_02129 modify TTL (d + INTERVAL 1 MONTH) DELETE WHERE c=1 settings mutations_sync=2;
|
|
|
|
select * from ttl_test_02129 order by a, b, d, c;
|
|
drop table ttl_test_02129;
|