
```
select *
from (
select 'table' as table, toInt64(10) as rows, toInt64(101) as elements
union all
select 'another table' as table, toInt64(0) as rows, toInt64(0) as elements
)
where rows - elements <> 0

DB::Exception: Block structure mismatch in Pipe::unitePipes stream: different number of columns:
table String String(size = 0), rows Int64 Int64(size = 0), elements Int64 Int64(size = 0)
table String String(size = 0), rows Int64 Int64(size = 0), elements Int64 Int64(size = 0), dummy UInt8 UInt8(size = 0) (version 21.5.3.1 (official build))
```
if (const ColumnWithTypeAndName * column_with_type_name = projection_block_for_keys.findByName(node->result_name))
        {
            if (node->type != ActionsDAG::ActionType::INPUT)
            {
                
                node->type = ActionsDAG::ActionType::INPUT;
                node->result_type = std::move(column_with_type_name->type);
                node->result_name = std::move(column_with_type_name->name);
                node->children.clear();
                inputs.push_back(node);
            }
        }
        for (const auto * child : node->children)
        {
            if (visited_nodes.count(child) == 0)
            {
                stack.push(const_cast<Node *>(child));
                visited_nodes.insert(child);
            }
        }
    }
    std::erase_if(inputs, [&](const Node * node) { return visited_nodes.count(node) == 0; });
    std::erase_if(index, [&](const Node * node) { return visited_index_names.count(node->result_name) == 0; });
    nodes.remove_if([&](const Node & node) { return visited_nodes.count(&node) == 0; });
    NameSet next_required_columns;
    for (const auto & input : inputs)
        next_required_columns.insert(input->result_name);
    return next_required_columns;
}
void ActionsDAG::reorderAggregationKeysForProjection(const std::unordered_map<std::string_view, size_t> & key_names_pos_map)