Review fixes.

This commit is contained in:
Nikolai Kochetov 2021-01-22 16:46:56 +03:00
parent af7dca7bb7
commit d683bf42ce
4 changed files with 11 additions and 4 deletions

View File

@ -946,7 +946,7 @@ std::pair<ActionsDAGPtr, ActionsDAGPtr> ActionsDAG::split(std::unordered_set<con
{
auto & child_data = data[child];
/// If children is not created, int may be from split part.
/// If children is not created, it may be from split part.
if (!child_data.to_second)
{
if (child->type == ActionType::COLUMN) /// Just create new node for COLUMN action.

View File

@ -600,6 +600,12 @@ static bool trySplitFilter(QueryPlan::Node * node, QueryPlan::Nodes & nodes)
void QueryPlan::optimize()
{
/* Stack contains info for every nodes in the path from tree root to the current node.
* Every optimization changes only current node and it's children.
* Optimization may change QueryPlanStep, but not QueryPlan::Node (only add a new one).
* So, QueryPlan::Node::children will be always valid.
*/
struct Frame
{
Node * node;

View File

@ -1,4 +1,4 @@
<test>
<query>select sum(x), sum(y) from (select sipHash64(number) as x, bitAnd(number, 1024) as y from numbers_mt(200000000)) where y = 0 settings enable_optimize_predicate_expression=0</query>
<query>select sum(x), sum(y) from (select sipHash64(number) as x, bitAnd(number, 1024) as y from numbers_mt(200000000) limit 200000000) where y = 0</query>
<query>select sum(x), sum(y) from (select sipHash64(number) as x, bitAnd(number, 1023) as y from numbers_mt(200000000)) where y = 0 settings enable_optimize_predicate_expression=0</query>
<query>select sum(x), sum(y) from (select sipHash64(number) as x, bitAnd(number, 1023) as y from numbers_mt(200000000) limit 200000000) where y = 0</query>
</test>

View File

@ -309,7 +309,8 @@
"01632_max_partitions_to_read",
"01638_div_mod_ambiguities",
"01642_if_nullable_regression",
"01643_system_suspend"
"01643_system_suspend",
"01655_plan_optimizations"
],
"parallel":
[