mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-14 19:45:11 +00:00
Analyzer: do not optimize GROUP BY keys with ROLLUP and CUBE
This commit is contained in:
parent
5629d73bdb
commit
d2e185d86d
@ -38,6 +38,9 @@ public:
|
||||
if (!query->hasGroupBy())
|
||||
return;
|
||||
|
||||
if (query->isGroupByWithCube() || query->isGroupByWithRollup())
|
||||
return;
|
||||
|
||||
auto & group_by = query->getGroupBy().getNodes();
|
||||
if (query->isGroupByWithGroupingSets())
|
||||
{
|
||||
|
@ -0,0 +1,8 @@
|
||||
a b
|
||||
a b
|
||||
a b
|
||||
b
|
||||
a b
|
||||
a b
|
||||
a b
|
||||
a b
|
7
tests/queries/0_stateless/02734_optimize_group_by.sql
Normal file
7
tests/queries/0_stateless/02734_optimize_group_by.sql
Normal file
@ -0,0 +1,7 @@
|
||||
SELECT 'a' AS key, 'b' as value GROUP BY key WITH CUBE SETTINGS allow_experimental_analyzer = 0;
|
||||
SELECT 'a' AS key, 'b' as value GROUP BY key WITH CUBE SETTINGS allow_experimental_analyzer = 1;
|
||||
|
||||
SELECT 'a' AS key, 'b' as value GROUP BY ignore(1) WITH CUBE;
|
||||
|
||||
SELECT 'a' AS key, 'b' as value GROUP BY ignore(1);
|
||||
SELECT 'a' AS key, 'b' as value GROUP BY key;
|
Loading…
Reference in New Issue
Block a user