```
select name, value, last_error_message from system.errors where name = 'FILE_DOESNT_EXIST';
0 rows in set. Elapsed: 0.001 sec.

select * from system.tables format Null;
select * from system.tables format Null;
select * from system.tables format Null;

select name, value, last_error_message from system.errors where name = 'FILE_DOESNT_EXIST';
┌─name──────────────┬─value─┬─last_error_message──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ FILE_DOESNT_EXIST │   198 │ Cannot open file /var/lib/clickhouse/store/bff/bff731ca-ed14-404b-bff7-31caed14904b/zeros_mt.sql, errno: 2, strerror: No such file or directory │
└───────────────────┴───────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
```
{
    auto & ast_create_query = query->as<ASTCreateQuery &>();
    bool has_structure = ast_create_query.columns_list && ast_create_query.columns_list->columns;
    if (ast_create_query.as_table_function && !has_structure)
        throw Exception(ErrorCodes::NOT_IMPLEMENTED, "Cannot alter table {} because it was created AS table function"
                                                     " and doesn't have structure in metadata", backQuote(ast_create_query.table));
    assert(has_structure);
    ASTPtr new_columns = InterpreterCreateQuery::formatColumns(metadata.columns);
    ASTPtr new_indices = InterpreterCreateQuery::formatIndices(metadata.secondary_indices);
    ASTPtr new_constraints = InterpreterCreateQuery::formatConstraints(metadata.constraints);
    ASTPtr new_projections = InterpreterCreateQuery::formatProjections(metadata.projections);
    ast_create_query.columns_list->replace(ast_create_query.columns_list->columns, new_columns);
    ast_create_query.columns_list->setOrReplace(ast_create_query.columns_list->indices, new_indices);
    ast_create_query.columns_list->setOrReplace(ast_create_query.columns_list->constraints, new_constraints);
    ast_create_query.columns_list->setOrReplace(ast_create_query.columns_list->projections, new_projections);
    if (metadata.select.select_query)
    {
        query->replace(ast_create_query.select, metadata.select.select_query);
    }
    
    if (ast_create_query.storage)
    {
        ASTStorage & storage_ast = *ast_create_query.storage;
        bool is_extended_storage_def
            = storage_ast.partition_by || storage_ast.primary_key || storage_ast.order_by || storage_ast.sample_by || storage_ast.settings;
        if (is_extended_storage_def)
        {
            if (metadata.sorting_key.definition_ast)
                storage_ast.set(storage_ast.order_by, metadata.sorting_key.definition_ast);
            if (metadata.primary_key.definition_ast)