**Describe the bug**
```
milovidov-desktop :) SET allow_experimental_analyzer = 1

SET allow_experimental_analyzer = 1

Query id: b4494b8c-9f14-4d46-8db9-2cb992dcfcb6

Ok.

0 rows in set. Elapsed: 0.001 sec. 

milovidov-desktop :) SELECT arrayFilter(x -> notEmpty(concat(x)), [NULL, NULL]) FROM system.one ARRAY JOIN [1048577] AS elem, arrayMap(x -> concat(x, elem, ''), ['']) AS unused

SELECT arrayFilter(x -> notEmpty(concat(x)), [NULL, NULL])
FROM system.one
ARRAY JOIN
    [1048577] AS elem,
    arrayMap(x -> concat(x, elem, ''), ['']) AS unused

Query id: ca118c75-812b-4c83-bd30-1af64ed38635


0 rows in set. Elapsed: 0.003 sec. 

Received exception from server (version 22.13.1):
Code: 49. DB::Exception: Received from localhost:9000. DB::Exception: Cannot capture column 3 because it has incompatible type: got Array(UInt32), but UInt32 is expected.. (LOGICAL_ERROR)
```
QueryTreeNodes group_by_keys_nodes;
    group_by_keys_nodes.reserve(query_node_typed.getGroupBy().getNodes().size());
    for (auto & node : query_node_typed.getGroupBy().getNodes())
    {
        if (query_node_typed.isGroupByWithGroupingSets())
        {
            auto & grouping_set_keys = node->as<ListNode &>();
            for (auto & grouping_set_key : grouping_set_keys.getNodes())
            {
                if (grouping_set_key->as<ConstantNode>())
                    continue;
                group_by_keys_nodes.push_back(grouping_set_key);
            }
        }
        else
        {
            if (node->as<ConstantNode>())
                continue;
            group_by_keys_nodes.push_back(node);
        }
    }
    if (query_node_typed.getGroupBy().getNodes().empty())
    {
        if (query_node_typed.hasHaving())
            assertNoGroupingFunction(query_node_typed.getHaving(), "in HAVING without GROUP BY");
        if (query_node_typed.hasOrderBy())
            assertNoGroupingFunction(query_node_typed.getOrderByNode(), "in ORDER BY without GROUP BY");
        assertNoGroupingFunction(query_node_typed.getProjectionNode(), "in SELECT without GROUP BY");
    }
    bool has_aggregation = !query_node_typed.getGroupBy().getNodes().empty() || !aggregate_function_nodes.empty();