mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-15 12:14:18 +00:00
Projection & optimize_aggregators_of_group_by_keys
Fix projection with optimize_aggregators_of_group_by_keys = true
This commit is contained in:
parent
49c1beb870
commit
1739bb306a
@ -142,6 +142,13 @@ ASTPtr ASTProjectionSelectQuery::cloneToASTSelect() const
|
||||
}
|
||||
if (groupBy())
|
||||
select_query->setExpression(ASTSelectQuery::Expression::GROUP_BY, groupBy()->clone());
|
||||
|
||||
auto settings_query = std::make_shared<ASTSetQuery>();
|
||||
SettingsChanges settings_changes;
|
||||
settings_changes.insertSetting("optimize_aggregators_of_group_by_keys", false);
|
||||
settings_query->changes = std::move(settings_changes);
|
||||
settings_query->is_standalone = false;
|
||||
select_query->setExpression(ASTSelectQuery::Expression::SETTINGS, std::move(settings_query));
|
||||
return node;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1 @@
|
||||
2012-10-23
|
@ -0,0 +1,7 @@
|
||||
drop table if exists proj;
|
||||
|
||||
CREATE TABLE proj(date Date, PROJECTION maxdate( SELECT max(date) GROUP BY date )) ENGINE = MergeTree ORDER BY tuple() as select toDate('2012-10-24')-number%100 from numbers(1e2);
|
||||
|
||||
SELECT max(date) FROM proj PREWHERE date != '2012-10-24';
|
||||
|
||||
drop table proj;
|
Loading…
Reference in New Issue
Block a user