From 874f7a505263aabf3f5bb949d707f065fa2526ef Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Fri, 22 Oct 2021 00:12:30 +0300 Subject: [PATCH] Add a test with optimized columns from PREWHERE --- .../02021_prewhere_column_optimization.reference | 7 +++++++ .../0_stateless/02021_prewhere_column_optimization.sql | 10 ++++++++++ 2 files changed, 17 insertions(+) create mode 100644 tests/queries/0_stateless/02021_prewhere_column_optimization.reference create mode 100644 tests/queries/0_stateless/02021_prewhere_column_optimization.sql diff --git a/tests/queries/0_stateless/02021_prewhere_column_optimization.reference b/tests/queries/0_stateless/02021_prewhere_column_optimization.reference new file mode 100644 index 00000000000..7f97e6efd69 --- /dev/null +++ b/tests/queries/0_stateless/02021_prewhere_column_optimization.reference @@ -0,0 +1,7 @@ +-- { echoOn } +select * from data_02021 prewhere 1 or ignore(key); +1 +select * from data_02021 prewhere 1 or ignore(key) where key = 1; +1 +select * from data_02021 prewhere 0 or ignore(key); +select * from data_02021 prewhere 0 or ignore(key) where key = 1; diff --git a/tests/queries/0_stateless/02021_prewhere_column_optimization.sql b/tests/queries/0_stateless/02021_prewhere_column_optimization.sql new file mode 100644 index 00000000000..4fe8b912c3f --- /dev/null +++ b/tests/queries/0_stateless/02021_prewhere_column_optimization.sql @@ -0,0 +1,10 @@ +drop table if exists data_02021; +create table data_02021 (key Int) engine=MergeTree() order by key; +insert into data_02021 values (1); +-- { echoOn } +select * from data_02021 prewhere 1 or ignore(key); +select * from data_02021 prewhere 1 or ignore(key) where key = 1; +select * from data_02021 prewhere 0 or ignore(key); +select * from data_02021 prewhere 0 or ignore(key) where key = 1; +-- { echoOff } +drop table data_02021;