Support per-schema DATA_PATH (hot/cold storage placement within one lake) #1381
esenilsson
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Use case
We run a dbt + DuckLake warehouse: Postgres catalog, data on S3-compatible object storage (Hetzner), compute on a VPS next to the catalog. The lake has the usual medallion shape — staging and intermediate schemas are written once per weekly load and rarely read interactively, while the mart and reporting schemas serve BI and ad-hoc queries all day.
Live footprint per schema:
Interactive query latency is dominated by S3 round-trips over a 1 Gbit link. We'd like the hot schemas (mart, reporting) to live on the VPS's local NVMe while the cold schemas stay on object storage — same catalog, same lake, different storage roots per schema.
What the spec already models
The metadata model is already hierarchical:
data_path→ducklake_schema.pathducklake_table.path→ducklake_data_file.path, each withpath_is_relative. So a schema rooted somewhere other thandata_pathis expressible in the catalog today — e.g. settingducklake_schema.pathto an absolutefile:///...path withpath_is_relative = false. But no SQL surface exposes this, and hand-editing the catalog is presumably unsupported.The ask
Something like:
with explicit semantics that
ALTER ... SET DATA_PATHaffects newly written files only — existing files keep their recorded (absolute-resolved) paths and remain readable, analogous to howSET PARTITIONED BYonly applies to new writes.Related
ducklake_data_file.pathentries to absolute paths for hot/cold tiering — and is unanswered. Per-schemaDATA_PATHwould cover the forward-looking half of that use case cleanly (new writes land in the right tier); migrating existing files would remain Hot/cold storage tiering via metadata path rewrites — dangerous? #937's territory (or "rewrite through a relayout copy").OVERRIDE_DATA_PATHand frozen ducklakes) touches the single-root assumption from another angle.Workaround we're considering meanwhile
A second DuckLake catalog with a local
data_pathfor mart/reporting, attached alongside the S3-rooted one, relying on DuckDB cross-database queries. It works but splits snapshots/time-travel and transactional boundaries across two catalogs, and every consumer must know to attach both — which is exactly what a per-schema path inside one lake would avoid.All reactions