From 575fa7f25a1bb685cf4509f5317067addbe353d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Vavru=C5=A1a?= Date: Tue, 2 Oct 2018 19:06:04 -0700 Subject: [PATCH] PushingToViewsBlockOutputStream: add tests for parallel processing This adds tests for a971a0bc07b83af564496879e1a219a4fba9d498 --- ...726_materialized_view_concurrent.reference | 4 ++++ .../00726_materialized_view_concurrent.sql | 22 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 dbms/tests/queries/0_stateless/00726_materialized_view_concurrent.reference create mode 100644 dbms/tests/queries/0_stateless/00726_materialized_view_concurrent.sql diff --git a/dbms/tests/queries/0_stateless/00726_materialized_view_concurrent.reference b/dbms/tests/queries/0_stateless/00726_materialized_view_concurrent.reference new file mode 100644 index 00000000000..52ee4350de7 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00726_materialized_view_concurrent.reference @@ -0,0 +1,4 @@ +2 +4 +1 +3 diff --git a/dbms/tests/queries/0_stateless/00726_materialized_view_concurrent.sql b/dbms/tests/queries/0_stateless/00726_materialized_view_concurrent.sql new file mode 100644 index 00000000000..1eb47943edd --- /dev/null +++ b/dbms/tests/queries/0_stateless/00726_materialized_view_concurrent.sql @@ -0,0 +1,22 @@ +DROP TABLE IF EXISTS test.src; +DROP TABLE IF EXISTS test.mv1; +DROP TABLE IF EXISTS test.mv2; + +USE test; + +CREATE TABLE src (x UInt8) ENGINE = Null; +CREATE MATERIALIZED VIEW mv1 ENGINE = Memory AS SELECT x FROM src WHERE x % 2 = 0; +CREATE MATERIALIZED VIEW mv2 ENGINE = Memory AS SELECT x FROM src WHERE x % 2 = 1; + +SET parallel_view_processing = 1; +INSERT INTO src VALUES (1), (2); + +SET parallel_view_processing = 0; +INSERT INTO src VALUES (3), (4); + +SELECT * FROM mv1 ORDER BY x; +SELECT * FROM mv2 ORDER BY x; + +DROP TABLE test.mv1; +DROP TABLE test.mv2; +DROP TABLE test.src; \ No newline at end of file