Try to remove ActionsDAG::removeColumn

This commit is contained in:
Nikolai Kochetov 2021-01-11 19:15:03 +03:00
parent ee094ed7fd
commit 24d462b018
3 changed files with 0 additions and 35 deletions

View File

@ -436,12 +436,6 @@ void ActionsDAG::project(const NamesWithAliases & projection)
settings.projected_output = true;
}
void ActionsDAG::removeColumn(const std::string & column_name)
{
auto & node = getNode(column_name);
index.remove(&node);
}
bool ActionsDAG::tryRestoreColumn(const std::string & column_name)
{
if (index.contains(column_name))

View File

@ -133,16 +133,6 @@ public:
insert(node);
}
void remove(Node * node)
{
auto it = map.find(node->result_name);
if (it != map.end())
return;
list.erase(it->second);
map.erase(it);
}
void remove(std::list<Node *>::iterator it)
{
auto map_it = map.find((*it)->result_name);
@ -219,8 +209,6 @@ public:
/// Add alias actions and remove unused columns from index. Also specify result columns order in index.
void project(const NamesWithAliases & projection);
/// Removes column from index.
void removeColumn(const std::string & column_name);
/// If column is not in index, try to find it in nodes and insert back into index.
bool tryRestoreColumn(const std::string & column_name);

View File

@ -1489,23 +1489,6 @@ void ExpressionAnalysisResult::finalize(const ExpressionActionsChain & chain, si
columns_to_remove.insert(step.required_output[i]);
}
if (!columns_to_remove.empty())
{
auto columns = prewhere_info->prewhere_actions->getResultColumns();
auto remove_actions = std::make_shared<ActionsDAG>();
for (const auto & column : columns)
{
if (columns_to_remove.count(column.name))
{
remove_actions->addInput(column);
remove_actions->removeColumn(column.name);
}
}
prewhere_info->remove_columns_actions = std::move(remove_actions);
}
columns_to_remove_after_prewhere = std::move(columns_to_remove);
}
else if (hasFilter())