**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)
```
if (has_aggregation)
    {
        ValidateGroupByColumnsVisitor validate_group_by_columns_visitor(group_by_keys_nodes, scope);
        if (query_node_typed.hasHaving())
            validate_group_by_columns_visitor.visit(query_node_typed.getHaving());
        if (query_node_typed.hasOrderBy())
            validate_group_by_columns_visitor.visit(query_node_typed.getOrderByNode());
        validate_group_by_columns_visitor.visit(query_node_typed.getProjectionNode());
    }
    if (!has_aggregation && (query_node_typed.isGroupByWithGroupingSets() || is_rollup_or_cube))
        throw Exception(ErrorCodes::NOT_IMPLEMENTED, "WITH TOTALS, ROLLUP, CUBE or GROUPING SETS are not supported without aggregation");
    /** WITH section can be safely removed, because WITH section only can provide aliases to query expressions
      * and CTE for other sections to use.
      *
      * Example: WITH 1 AS constant, (x -> x + 1) AS lambda, a AS (SELECT * FROM test_table);
      */
    query_node_typed.getWith().getNodes().clear();
    /** WINDOW section can be safely removed, because WINDOW section can only provide window definition to window functions.
      *
      * Example: SELECT count(*) OVER w FROM test_table WINDOW w AS (PARTITION BY id);
      */
    query_node_typed.getWindow().getNodes().clear();
    
    for (auto & [_, node] : scope.alias_name_to_expression_node)
        node->removeAlias();
    for (auto & [_, node] : scope.alias_name_to_lambda_node)
        node->removeAlias();
    query_node_typed.resolveProjectionColumns(std::move(projection_columns));
}
void QueryAnalyzer::resolveUnion(const QueryTreeNodePtr & union_node, IdentifierResolveScope & scope)