```
CREATE TABLE a
(
    `number` UInt64,
    `x` MATERIALIZED x
)
ENGINE = MergeTree
ORDER BY number;
-- that should fail!

insert into a values (1);
Received exception from server (version 21.7.1):
Code: 47. DB::Exception: Received from localhost:9000. DB::Exception: Missing columns: 'x' while processing query: 'CAST(x, 'UInt8') AS x', required columns: 'x' 'x'. 
```
ss << " '" << column.name << "'";
        }
        if (!array_join_sources.empty())
        {
            ss << ", arrayJoin columns:";
            for (const auto & name : array_join_sources)
                ss << " '" << name << "'";
        }
        throw Exception(ss.str(), ErrorCodes::UNKNOWN_IDENTIFIER);
    }
    required_source_columns.swap(source_columns);
}
NameSet TreeRewriterResult::getArrayJoinSourceNameSet() const
{
    NameSet forbidden_columns;
    for (const auto & elem : array_join_result_to_source)
        forbidden_columns.insert(elem.first);
    return forbidden_columns;
}
TreeRewriterResultPtr TreeRewriter::analyzeSelect(
    ASTPtr & query,
    TreeRewriterResult && result,
    const SelectQueryOptions & select_options,
    const std::vector<TableWithColumnNamesAndTypes> & tables_with_columns,
    const Names & required_result_columns,
    std::shared_ptr<TableJoin> table_join) const
{
    auto * select_query = query->as<ASTSelectQuery>();
    if (!select_query)
        throw Exception("Select analyze for not select asts.", ErrorCodes::LOGICAL_ERROR);