Skip to content

Catalog loader cannot pass a Runtime to the catalog it builds #3285

Closed

Description

@NoahKusaba

Is your feature request related to a problem or challenge?

CatalogBuilder::with_runtime lets a caller choose the runtime a catalog, and the tables it creates, spawn their work on (scan planning, delete file processing). A catalog built through iceberg-catalog-loader cannot be given one: BoxedCatalogBuilder forwards with_storage_factory and with_kms_client_factory to the underlying CatalogBuilder, but has no with_runtime.

So a catalog chosen by type at runtime (iceberg_catalog_loader::load("rest")) always uses the runtime current when it is built, since the builders fall back to Runtime::current(). An application that keeps Iceberg work on a dedicated runtime, for example so that catalog clients and cached tables outlive the runtime of the request that built them, has to either build every catalog inside that runtime or give up the loader and match on catalog types itself.

Describe the solution you'd like

Add with_runtime to BoxedCatalogBuilder, forwarding to CatalogBuilder::with_runtime the same way the other two methods are forwarded:

let catalog = iceberg_catalog_loader::load("rest")?
    .with_runtime(runtime)
    .load("rest".to_string(), props)
    .await?;

This mirrors how with_kms_client_factory was added to the loader in #2650. Every builder in the loader's registry already implements CatalogBuilder::with_runtime, so nothing else changes.

Willingness to contribute

I can contribute to this feature independently

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions