mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-21 17:20:50 +00:00
Poison only columns actually used by ARRAY_JOIN and JOIN
This commit is contained in:
parent
5482282943
commit
c419d5a1a5
@ -1006,9 +1006,6 @@ void ExpressionActions::compileFunctions([[maybe_unused]] const NameSet & final_
|
||||
{
|
||||
switch (actions[i].type)
|
||||
{
|
||||
case ExpressionAction::ADD_COLUMN:
|
||||
break;
|
||||
|
||||
case ExpressionAction::REMOVE_COLUMN:
|
||||
current_dependents.erase(actions[i].source_name);
|
||||
/// poison every other column used after this point so that inlining chains do not cross it.
|
||||
@ -1016,22 +1013,22 @@ void ExpressionActions::compileFunctions([[maybe_unused]] const NameSet & final_
|
||||
dep.second.emplace();
|
||||
break;
|
||||
|
||||
case ExpressionAction::COPY_COLUMN:
|
||||
current_dependents[actions[i].source_name].emplace();
|
||||
break;
|
||||
|
||||
case ExpressionAction::PROJECT:
|
||||
current_dependents.clear();
|
||||
for (const auto & proj : actions[i].projection)
|
||||
current_dependents[proj.first].emplace();
|
||||
break;
|
||||
|
||||
case ExpressionAction::ADD_COLUMN:
|
||||
case ExpressionAction::COPY_COLUMN:
|
||||
case ExpressionAction::ARRAY_JOIN:
|
||||
case ExpressionAction::JOIN:
|
||||
/// assume these actions can read everything; all columns not removed before this point are poisoned.
|
||||
for (size_t j = i; j--;)
|
||||
current_dependents[actions[j].result_name].emplace();
|
||||
{
|
||||
Names columns = actions[i].getNeededColumns();
|
||||
for (const auto & column : columns)
|
||||
current_dependents[column].emplace();
|
||||
break;
|
||||
}
|
||||
|
||||
case ExpressionAction::APPLY_FUNCTION:
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user