ClickHouse/tests/queries/0_stateless/01275_parallel_mv.sql

38 lines
1.5 KiB
MySQL
Raw Normal View History

2020-05-08 16:15:49 +00:00
drop table if exists testX;
drop table if exists testXA;
drop table if exists testXB;
drop table if exists testXC;
create table testX (A Int64) engine=MergeTree order by tuple();
create materialized view testXA engine=MergeTree order by tuple() as select sleep(1) from testX;
create materialized view testXB engine=MergeTree order by tuple() as select sleep(2), throwIf(A=1) from testX;
create materialized view testXC engine=MergeTree order by tuple() as select sleep(1) from testX;
2021-10-05 19:20:46 +00:00
-- { echoOn }
2020-05-08 16:15:49 +00:00
set parallel_view_processing=1;
2021-10-05 19:20:46 +00:00
insert into testX select number from numbers(10) settings log_queries=1; -- { serverError FUNCTION_THROW_IF_VALUE_IS_NON_ZERO }
system flush logs;
select length(thread_ids) from system.query_log where current_database = currentDatabase() and type != 'QueryStart' and query like '%insert into testX %' and Settings['parallel_view_processing'] = '1';
2020-05-08 16:15:49 +00:00
select count() from testX;
select count() from testXA;
select count() from testXB;
select count() from testXC;
2020-11-11 15:29:36 +00:00
2021-10-05 19:20:46 +00:00
set parallel_view_processing=0;
insert into testX select number from numbers(10) settings log_queries=1; -- { serverError FUNCTION_THROW_IF_VALUE_IS_NON_ZERO }
system flush logs;
select length(thread_ids) from system.query_log where current_database = currentDatabase() and type != 'QueryStart' and query like '%insert into testX %' and Settings['parallel_view_processing'] = '0';
select count() from testX;
select count() from testXA;
select count() from testXB;
select count() from testXC;
-- { echoOff }
2020-11-11 15:29:36 +00:00
drop table testX;
drop view testXA;
drop view testXB;
drop view testXC;