Skip to content

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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions