Fix ActionsDAG::removeUnusedResult

This commit is contained in:
Nikolai Kochetov 2021-02-12 18:20:54 +03:00
parent 683d793cc2
commit bbed905461

View File

@ -490,6 +490,11 @@ bool ActionsDAG::removeUnusedResult(const std::string & column_name)
if (col == child)
return false;
/// Do not remove input if it was mentioned in index several times.
for (const auto * node : index)
if (col == node)
return false;
/// Remove from nodes and inputs.
for (auto jt = nodes.begin(); jt != nodes.end(); ++jt)
{