ClickHouse/tests/queries/0_stateless/01710_projection_fetch.sql

21 lines
980 B
MySQL
Raw Normal View History

2021-05-11 11:44:59 +00:00
drop table if exists tp_1;
drop table if exists tp_2;
2021-05-11 14:07:19 +00:00
create table tp_1 (x Int32, y Int32, projection p (select x, y order by x)) engine = ReplicatedMergeTree('/clickhouse/tables/01710_projection_fetch_' || currentDatabase(), '1') order by y settings min_rows_for_compact_part = 2, min_rows_for_wide_part = 4, min_bytes_for_compact_part = 16, min_bytes_for_wide_part = 32;
2021-05-11 11:44:59 +00:00
2021-05-11 14:07:19 +00:00
create table tp_2 (x Int32, y Int32, projection p (select x, y order by x)) engine = ReplicatedMergeTree('/clickhouse/tables/01710_projection_fetch_' || currentDatabase(), '2') order by y settings min_rows_for_compact_part = 2, min_rows_for_wide_part = 4, min_bytes_for_compact_part = 16, min_bytes_for_wide_part = 32;
2021-05-11 11:44:59 +00:00
insert into tp_1 select number, number from numbers(3);
system sync replica tp_2;
select * from tp_2 order by x;
insert into tp_1 select number, number from numbers(5);
system sync replica tp_2;
select * from tp_2 order by x;
drop table if exists tp_1;
drop table if exists tp_2;