As discussed with @kitaisreal 
{
    if (column_names.empty())
    {
        auto list_of_columns = listOfColumns(getColumns().getAllPhysicalWithSubcolumns());
        throw Exception(ErrorCodes::EMPTY_LIST_OF_COLUMNS_QUERIED,
            "Empty list of columns queried. There are columns: {}", list_of_columns);
    }
    const auto virtuals_map = getColumnsMap(virtuals);
    auto unique_names = initUniqueStrings();
    for (const auto & name : column_names)
    {
        bool has_column = getColumns().hasColumnOrSubcolumn(ColumnsDescription::AllPhysical, name) || virtuals_map.count(name);
        if (!has_column)
        {
            auto list_of_columns = listOfColumns(getColumns().getAllPhysicalWithSubcolumns());
            throw Exception(ErrorCodes::NO_SUCH_COLUMN_IN_TABLE,
                "There is no column with name {} in table {}. There are columns: {}",
                backQuote(name), storage_id.getNameForLogs(), list_of_columns);
        }
        if (unique_names.end() != unique_names.find(name))
            throw Exception(ErrorCodes::COLUMN_QUERIED_MORE_THAN_ONCE, "Column {} queried more than once", name);
        unique_names.insert(name);
    }
}
void StorageInMemoryMetadata::check(const NamesAndTypesList & provided_columns) const