Skip to content

Commit 8250d56

Browse files
author
Christian
committed
Feat: add override_data_path to ducklake connection
Signed-off-by: Christian <christian@datenberge.de>
1 parent 3be5bba commit 8250d56

3 files changed

Lines changed: 8 additions & 0 deletions

File tree

docs/integrations/engines/duckdb.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ SQLMesh will place models with the explicit catalog "ephemeral", such as `epheme
7979
type: ducklake
8080
path: 'catalog.ducklake'
8181
data_path: data/ducklake
82+
override_data_path: true
8283
encrypted: True
8384
data_inlining_row_limit: 10
8485
metadata_schema: main
@@ -105,6 +106,7 @@ SQLMesh will place models with the explicit catalog "ephemeral", such as `epheme
105106
type="ducklake",
106107
path="catalog.ducklake",
107108
data_path="data/ducklake",
109+
override_data_path=False,
108110
encrypted=True,
109111
data_inlining_row_limit=10,
110112
metadata_schema="main",
@@ -120,6 +122,7 @@ SQLMesh will place models with the explicit catalog "ephemeral", such as `epheme
120122

121123
- `path`: Path to the DuckLake catalog file
122124
- `data_path`: Path where DuckLake data files are stored
125+
- `override_data_path`: Whether data_override_path option is set
123126
- `encrypted`: Whether to enable encryption for the catalog (default: `False`)
124127
- `data_inlining_row_limit`: Maximum number of rows to inline in the catalog (default: `0`)
125128
- `metadata_schema`: The schema in the catalog server in which to store the DuckLake metadata tables (default: `main`)
@@ -364,6 +367,7 @@ The `filesystems` accepts a list of file systems to register in the DuckDB conne
364367
type: ducklake
365368
path: myducklakecatalog.duckdb
366369
data_path: abfs://MyFabricWorkspace/MyFabricLakehouse.Lakehouse/Files/DuckLake.Files
370+
override_data_path: False
367371
extensions:
368372
- ducklake
369373
filesystems:

sqlmesh/core/config/connection.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ class DuckDBAttachOptions(BaseConfig):
238238

239239
# DuckLake specific options
240240
data_path: t.Optional[str] = None
241+
override_data_path: t.Optional[bool] = False
241242
encrypted: bool = False
242243
data_inlining_row_limit: t.Optional[int] = None
243244
metadata_schema: t.Optional[str] = None
@@ -258,6 +259,8 @@ def to_sql(self, alias: str) -> str:
258259
path = f"ducklake:{path}"
259260
if self.data_path is not None:
260261
options.append(f"DATA_PATH '{self.data_path}'")
262+
if self.override_data_path:
263+
options.append("OVERRIDE_DATA_PATH true")
261264
if self.encrypted:
262265
options.append("ENCRYPTED")
263266
if self.data_inlining_row_limit is not None:

tests/core/test_connection_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,7 @@ def test_duckdb_attach_ducklake_catalog(make_config):
810810
type="ducklake",
811811
path="catalog.ducklake",
812812
data_path="/tmp/ducklake_data",
813+
override_data_path=False,
813814
encrypted=True,
814815
data_inlining_row_limit=10,
815816
),

0 commit comments

Comments
 (0)