**Describe the bug**

"Not found column ... in block" error, when join on alias column.

**How to reproduce**

```sql
CREATE TABLE a (
    id UInt32,
    value UInt32,
    id_alias UInt32 ALIAS id    
) ENGINE = MergeTree() ORDER BY id;

CREATE TABLE b (
    id UInt32,
    value UInt32
) ENGINE = MergeTree() ORDER BY id;

INSERT INTO a VALUES (1, 1), (2, 2), (3, 3);
INSERT INTO b VALUES (1, 4), (2, 5), (3, 6);

SELECT * FROM a JOIN b ON a.id_alias = b.id;
```

**Expected behavior**

In version 21.5.9.4 result is:

id | value | b.id | b.value
-- | -------- | ----- | ----------
1 |  1 | 1 | 4 
2 | 2 | 2 | 5 
3 | 3 | 3 | 6 

**Error message and/or stacktrace**

In version 21.7.5.29 result is:
```
SQL Error [10]: ClickHouse exception, code: 10, host: 127.0.0.1, port: 14343; Code: 10, e.displayText() = DB::Exception: Not found column id_alias in block. There are only columns: id, value (version 21.7.5.29 (official build))
```
return std::make_shared<const TreeRewriterResult>(result);
}
TreeRewriterResultPtr TreeRewriter::analyze(
    ASTPtr & query,
    const NamesAndTypesList & source_columns,
    ConstStoragePtr storage,
    const StorageMetadataPtr & metadata_snapshot,
    bool allow_aggregations,
    bool allow_self_aliases) const
{
    if (query->as<ASTSelectQuery>())
        throw Exception("Not select analyze for select asts.", ErrorCodes::LOGICAL_ERROR);
    const auto & settings = getContext()->getSettingsRef();
    TreeRewriterResult result(source_columns, storage, metadata_snapshot, false);
    normalize(query, result.aliases, result.source_columns_set, false, settings, allow_self_aliases);
    
    executeScalarSubqueries(query, getContext(), 0, result.scalars, false);
    if (settings.legacy_column_name_of_tuple_literal)
        markTupleLiteralsAsLegacy(query);
    TreeOptimizer::optimizeIf(query, result.aliases, settings.optimize_if_chain_to_multiif);
    if (allow_aggregations)
    {
        GetAggregatesVisitor::Data data;
        GetAggregatesVisitor(data).visit(query);
        
        for (const ASTFunction * node : data.aggregates)
            for (auto & arg : node->arguments->children)
                assertNoAggregates(arg, "inside another aggregate function");
        result.aggregates = data.aggregates;
    }