Skip to content

Iceberg DataLakeCatalog: ALTER DELETE fails with Metadata is not initialized (LOGICAL_ERROR) #2136

Closed

Description

@DimensionWieldr

Describe the bug

ALTER TABLE … DELETE against an Iceberg table accessed through DataLakeCatalog fails with:

Code: 49. DB::Exception: Metadata is not initialized. (LOGICAL_ERROR)

The same delete works against a path-based ENGINE = Iceberg(...) table. INSERT into the same DataLakeCatalog table works when allow_insert_into_iceberg = 1.

How to reproduce

Requires a REST Iceberg catalog (e.g. ice-rest-catalog) with an existing merge-on-read table, then:

SET allow_experimental_database_iceberg = 1;
SET allow_insert_into_iceberg = 1;

CREATE DATABASE datalake_db
ENGINE = DataLakeCatalog('http://ice-rest-catalog:5000', 'minio_key', 'minio_secret')
SETTINGS
    catalog_type = 'rest',
    storage_endpoint = 'http://minio:9000/warehouse',
    warehouse = 's3://bucket1/',
    auth_header = 'Authorization: Bearer foo';

-- Assume catalog table `ns.t` already exists (format-version 2, write.delete.mode = merge-on-read)
-- and has been seeded with rows (id, data).

-- SELECT / INSERT via catalog work; DELETE does not:
ALTER TABLE datalake_db.`ns.t` DELETE WHERE id <= 2;

Observed error:

Code: 49. DB::Exception: Metadata is not initialized. (LOGICAL_ERROR)

By contrast, the path-based engine succeeds:

CREATE TABLE iceberg_path
ENGINE = Iceberg('http://minio:9000/warehouse/data/ns/t', 'minio_key', 'minio_secret');

SET allow_insert_into_iceberg = 1;
ALTER TABLE iceberg_path DELETE WHERE id <= 2;  -- OK, writes position deletes

Observed on 26.3.13.20001.altinityantalya.

Expected behavior

With allow_insert_into_iceberg = 1, ALTER TABLE <datalake_db>.'ns.t' DELETE WHERE … should write Iceberg position deletes and commit through the catalog, same as ENGINE = Iceberg.

Activity

  1. DimensionWieldr commented on Jul 31, 2026

    @DimensionWieldr
    CollaboratorAuthor

    Same bug was already reported and fixed upstream:

    26.3.13.20001.altinityantalya still hits the bug on DataLakeCatalog ALTER DELETE (upstream fix is on 26.4+).

  2. subkanthi commented on Aug 7, 2026

    @subkanthi
    Collaborator

    @DimensionWieldr tried this on #2157

    select * from ice.`flowers.sample`;
    
    SELECT *
    FROM ice.`flowers.sample`
    
    Query id: fb087678-c4db-44d3-9434-9d223d2f762d
    
        ┌─value─┐
     1. │     1 │
     2. │     2 │
     3. │     3 │
     4. │     4 │
     5. │     5 │
     6. │     6 │
     7. │     7 │
     8. │     8 │
     9. │     9 │
    10. │    10 │
        └───────┘
    
    alter table ice.`flowers.sample` delete where value=1;
    
    ALTER TABLE ice.`flowers.sample`
        (DELETE WHERE value = 1)
    
    Query id: 6b5adcf9-574f-4fe6-9983-a9b4ab01da55
    
    Ok.
    
    0 rows in set. Elapsed: 0.401 sec. 
    
    select * from ice.`flowers.sample`;
    
    SELECT *
    FROM ice.`flowers.sample`
    
    Query id: 8d10dad9-f1fc-4ab0-b6d2-e7492b75ac5e
    
       ┌─value─┐
    1. │     2 │
    2. │     3 │
    3. │     4 │
    4. │     5 │
    5. │     6 │
    6. │     7 │
    7. │     8 │
    8. │     9 │
    9. │    10 │
       └───────┘
    
    9 rows in set. Elapsed: 0.042 sec. 
    
  3. self-assigned this
    on Aug 7, 2026
  4. DimensionWieldr commented on Aug 21, 2026

    @DimensionWieldr
    CollaboratorAuthor

    Fixed by #2157 , version 26.6, no need to backport to older versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

antalyabugSomething isn't workingcatalogsAntalya Roadmap: Catalogsiceberg writesAntalya Roadmap: Iceberg Writes

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions