diff --git a/docs/integrations/engines/duckdb.md b/docs/integrations/engines/duckdb.md index 5f63a4688d..aca58615b3 100644 --- a/docs/integrations/engines/duckdb.md +++ b/docs/integrations/engines/duckdb.md @@ -79,6 +79,7 @@ SQLMesh will place models with the explicit catalog "ephemeral", such as `epheme type: ducklake path: 'catalog.ducklake' data_path: data/ducklake + override_data_path: true encrypted: True data_inlining_row_limit: 10 metadata_schema: main @@ -105,6 +106,7 @@ SQLMesh will place models with the explicit catalog "ephemeral", such as `epheme type="ducklake", path="catalog.ducklake", data_path="data/ducklake", + override_data_path=False, encrypted=True, data_inlining_row_limit=10, metadata_schema="main", @@ -120,6 +122,7 @@ SQLMesh will place models with the explicit catalog "ephemeral", such as `epheme - `path`: Path to the DuckLake catalog file - `data_path`: Path where DuckLake data files are stored +- `override_data_path`: Whether data_override_path option is set - `encrypted`: Whether to enable encryption for the catalog (default: `False`) - `data_inlining_row_limit`: Maximum number of rows to inline in the catalog (default: `0`) - `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 type: ducklake path: myducklakecatalog.duckdb data_path: abfs://MyFabricWorkspace/MyFabricLakehouse.Lakehouse/Files/DuckLake.Files + override_data_path: False extensions: - ducklake filesystems: diff --git a/sqlmesh/core/config/connection.py b/sqlmesh/core/config/connection.py index d930537711..8d612dd3c2 100644 --- a/sqlmesh/core/config/connection.py +++ b/sqlmesh/core/config/connection.py @@ -238,6 +238,7 @@ class DuckDBAttachOptions(BaseConfig): # DuckLake specific options data_path: t.Optional[str] = None + override_data_path: t.Optional[bool] = False encrypted: bool = False data_inlining_row_limit: t.Optional[int] = None metadata_schema: t.Optional[str] = None @@ -258,6 +259,8 @@ def to_sql(self, alias: str) -> str: path = f"ducklake:{path}" if self.data_path is not None: options.append(f"DATA_PATH '{self.data_path}'") + if self.override_data_path: + options.append("OVERRIDE_DATA_PATH true") if self.encrypted: options.append("ENCRYPTED") if self.data_inlining_row_limit is not None: diff --git a/tests/core/test_connection_config.py b/tests/core/test_connection_config.py index 2ff95525f7..5a35f137a3 100644 --- a/tests/core/test_connection_config.py +++ b/tests/core/test_connection_config.py @@ -810,6 +810,7 @@ def test_duckdb_attach_ducklake_catalog(make_config): type="ducklake", path="catalog.ducklake", data_path="/tmp/ducklake_data", + override_data_path=False, encrypted=True, data_inlining_row_limit=10, ),