From 99073c26ee2692f8efe2ab14b2d8ae0fd813b80e Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Wed, 25 Nov 2020 00:00:55 +0300 Subject: [PATCH] Added a test for what was always working --- tests/queries/0_stateless/01586_columns_pruning.reference | 1 + tests/queries/0_stateless/01586_columns_pruning.sql | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 tests/queries/0_stateless/01586_columns_pruning.reference create mode 100644 tests/queries/0_stateless/01586_columns_pruning.sql diff --git a/tests/queries/0_stateless/01586_columns_pruning.reference b/tests/queries/0_stateless/01586_columns_pruning.reference new file mode 100644 index 00000000000..749fce669df --- /dev/null +++ b/tests/queries/0_stateless/01586_columns_pruning.reference @@ -0,0 +1 @@ +1000000 diff --git a/tests/queries/0_stateless/01586_columns_pruning.sql b/tests/queries/0_stateless/01586_columns_pruning.sql new file mode 100644 index 00000000000..4ae6b6c7c10 --- /dev/null +++ b/tests/queries/0_stateless/01586_columns_pruning.sql @@ -0,0 +1,4 @@ +-- Unneeded column is removed from subquery. +SELECT count() FROM (SELECT number, groupArray(repeat(toString(number), 1000000)) FROM numbers(1000000) GROUP BY number); +-- Unneeded column cannot be removed from subquery and the query is out of memory +SELECT count() FROM (SELECT number, groupArray(repeat(toString(number), 1000000)) AS agg FROM numbers(1000000) GROUP BY number HAVING notEmpty(agg)); -- { serverError 241 }