Skip to content

Support Lance Namespace table addressing (catalog-managed Lance tables, e.g. Gravitino Lance REST server) #50

Description

@FANNG1

Use case

We manage Lance tables through an Apache Gravitino Lance REST
server, which implements the Lance Namespace REST
protocol. The catalog owns the table hierarchy (catalog.schema.table), decides each table's
storage location, and can vend object-store credentials to clients via describe_table.

On the compute side we use Daft (with daft-lance) for multimodal data processing over these
tables: distributed reads, bulk writes, column backfill via merge_columns_df (e.g. adding
embedding columns), scalar index builds, and compaction.

Today every daft-lance entry point addresses a table by raw URI only. That forces us to:

  • resolve table_id -> storage location out of band before every job, and keep that resolution
    logic in every pipeline;
  • distribute object-store credentials to jobs ourselves, even though the catalog can vend
    scoped credentials per table;
  • give up the catalog's create/commit integration (tables written by Daft are not registered
    back into the namespace).

Proposal

Add Lance Namespace addressing to daft-lance: every table-addressing entry point
(read_lance, write_lance, merge_columns, merge_columns_df, create_scalar_index,
compact_files) accepts a namespace triple as an alternative to uri:

import daft_lance

ns = {
    "namespace_impl": "rest",
    "namespace_properties": {"uri": "http://gravitino-host:9101/lance"},
}

daft_lance.write_lance(df, table_id=["catalog", "schema", "orders"], mode="create", **ns)
df = daft_lance.read_lance(table_id=["catalog", "schema", "orders"], **ns)

Key requirements from our production scenario:

  • Distributed-safe: namespace clients are not picklable; workers must be able to rebuild
    the client from serializable parameters.
  • Credential vending: storage options returned by the namespace must reach every dataset
    open/commit, layered with the user's io_config as fallback.
  • Correct create semantics against a real catalog: declare_table registration, tolerance
    for declared-only placeholder tables (some servers materialize a stub at declare time),
    and no catalog side effects at plan-construction time.
  • Works with pylance >= 7, which accepts namespace_client + table_id natively.

Implementation

We have an implementation of the above in #35, validated against both the dir namespace and
a Gravitino Lance REST server (gated e2e test). Filing this issue to describe the motivating
scenario and gather feedback on the API surface.

Activity

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