Skip to content

feat(lake): the attach seam for datasets — DuckLake METADATA_SCHEMA plumbed end to end - #380

Merged
athvin merged 1 commit into
mainfrom
bm/datasets-p1-attach-seam
Nov 2, 2026
Merged

athvin merged 1 commit into
mainfrom
bm/datasets-p1-attach-seam

Conversation

@athvin

@athvin athvin commented Nov 2, 2026

Copy link
Copy Markdown
Owner

PR 1 of the datasets program (many independent resolution domains per org — plan approved 2026-11-02). Inert: nothing sets the new key yet, every existing lake opens exactly as before.

What

  • DuckLakeConfig.metadata_schema → emits DuckLake's METADATA_SCHEMA attach option; the er-entity-diff twin attach gains the same parameter (the two are documented as kept-in-step).
  • er_cli::open_lake_with(catalog, data_path, catalog_schema); open_lake stays as the None wrapper.
  • er-server: new schema::open_lake_env(env) replaces the eight hand-rolled env → open_lake sites (dispatcher ×4, handlers ×3, reconcile); the read path (read::open_org_lake) honours the key too.
  • New env key ER_LAKE_CATALOG_SCHEMA — deliberately not a variant of ER_LAKE_METADATA_SCHEMA, which despite its name sets the user-table schema. The ducklake-lakehouse skill (body + attach-and-tenancy reference) is updated accordingly, resolving its own recorded naming-trap TODO.

Why

Each dataset will be an independent DuckLake catalog inside its org's one er_t_<org> Postgres metadata database + its own data path, so every session keeps attaching exactly one lake as lake.main.* and the engine stays untouched.

Proof

pg_lake_catalog_schema (new, behind ER_TEST_PG_DSN, runs in the ducklake-e2e job) pins the three properties the design stands on:

  1. the first attach creates the metadata schema;
  2. two schemas in one Postgres database are fully disjoint lakes;
  3. a schema is pinned to its DATA_PATH — re-attach under a different one is refused, naming the mismatch.

Verified locally: the new test green ×3 against Postgres 16, and make check green.

🤖 Generated with Claude Code

…lumbed end to end

A dataset will be an independent lake inside its org's one Postgres metadata
database, separated by DuckLake's METADATA_SCHEMA attach option. This lands
that seam, inert: DuckLakeConfig.metadata_schema (and the er-entity-diff twin
attach, kept in step), er_cli::open_lake_with, and one er-server helper
(schema::open_lake_env) replacing the eight hand-rolled env->open sites. The
new env key is ER_LAKE_CATALOG_SCHEMA — deliberately NOT a variant of
ER_LAKE_METADATA_SCHEMA, which despite its name is the user-table schema.

pg_lake_catalog_schema proves the three properties the datasets design stands
on: the first attach creates the schema; two schemas in one database are fully
disjoint lakes; and a schema is pinned to its DATA_PATH — re-attaching it under
a different one is refused rather than silently re-pointed.

Nothing sets the new key yet, so every existing lake opens exactly as before.

Co-Authored-By: Claude Fable 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants