```
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'. 
```
const String & column_name = it->name;
        unknown_required_source_columns.erase(column_name);
        if (!required.count(column_name))
            source_columns.erase(it++);
        else
            ++it;
    }
    
    
    if (storage)
    {
        const auto storage_virtuals = storage->getVirtuals();
        for (auto it = unknown_required_source_columns.begin(); it != unknown_required_source_columns.end();)
        {
            auto column = storage_virtuals.tryGetByName(*it);
            if (column)
            {
                source_columns.push_back(*column);
                unknown_required_source_columns.erase(it++);
            }
            else
                ++it;
        }
    }
    if (!unknown_required_source_columns.empty())
    {
        WriteBufferFromOwnString ss;
        ss << "Missing columns:";
        for (const auto & name : unknown_required_source_columns)
            ss << " '" << name << "'";