diff --git a/src/Interpreters/ActionsDAG.cpp b/src/Interpreters/ActionsDAG.cpp index 528dade25ae3..de2adf3f9ada 100644 --- a/src/Interpreters/ActionsDAG.cpp +++ b/src/Interpreters/ActionsDAG.cpp @@ -1762,6 +1762,10 @@ ActionsDAG::SplitResult ActionsDAG::split(std::unordered_set split } } + /// All input nodes are needed by split to make sure first DAG and initial DAG have equal inputs, + for (const auto * input: inputs) + data[input].needed_by_split_node = true; + /// DFS. Move nodes to one of the DAGs. for (const auto & node : nodes) {