Skip to content

Commit 9e2a5f9

Browse files
authored
Feat: add ducklake DATA_INLINING_ROW_LIMIT attach option (#4635)
1 parent 57a32f7 commit 9e2a5f9

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

docs/integrations/engines/duckdb.md

Lines changed: 3 additions & 1 deletion
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
path: 'catalog.ducklake'
8080
data_path: data/ducklake
8181
encrypted: True
82+
data_inlining_row_limit: 10
8283
```
8384

8485
=== "Python"
@@ -102,7 +103,8 @@ SQLMesh will place models with the explicit catalog "ephemeral", such as `epheme
102103
type="ducklake",
103104
path="catalog.ducklake",
104105
data_path="data/ducklake",
105-
encrypted=True
106+
encrypted=True,
107+
data_inlining_row_limit=10,
106108
),
107109
}
108110
)

sqlmesh/core/config/connection.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ class DuckDBAttachOptions(BaseConfig):
224224
# DuckLake specific options
225225
data_path: t.Optional[str] = None
226226
encrypted: bool = False
227+
data_inlining_row_limit: t.Optional[int] = None
227228

228229
def to_sql(self, alias: str) -> str:
229230
options = []
@@ -236,10 +237,12 @@ def to_sql(self, alias: str) -> str:
236237

237238
# DuckLake specific options
238239
if self.type == "ducklake":
239-
if self.data_path:
240+
if self.data_path is not None:
240241
options.append(f"DATA_PATH '{self.data_path}'")
241242
if self.encrypted:
242243
options.append("ENCRYPTED")
244+
if self.data_inlining_row_limit is not None:
245+
options.append(f"DATA_INLINING_ROW_LIMIT {self.data_inlining_row_limit}")
243246

244247
options_sql = f" ({', '.join(options)})" if options else ""
245248
alias_sql = ""

tests/core/test_connection_config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,7 @@ def test_duckdb_attach_ducklake_catalog(make_config):
611611
path="catalog.ducklake",
612612
data_path="/tmp/ducklake_data",
613613
encrypted=True,
614+
data_inlining_row_limit=10,
614615
),
615616
},
616617
)
@@ -621,9 +622,11 @@ def test_duckdb_attach_ducklake_catalog(make_config):
621622
assert ducklake_catalog.path == "catalog.ducklake"
622623
assert ducklake_catalog.data_path == "/tmp/ducklake_data"
623624
assert ducklake_catalog.encrypted is True
625+
assert ducklake_catalog.data_inlining_row_limit == 10
624626
# Check that the generated SQL includes DATA_PATH
625627
assert "DATA_PATH '/tmp/ducklake_data'" in ducklake_catalog.to_sql("ducklake")
626628
assert "ENCRYPTED" in ducklake_catalog.to_sql("ducklake")
629+
assert "DATA_INLINING_ROW_LIMIT 10" in ducklake_catalog.to_sql("ducklake")
627630

628631

629632
def test_duckdb_attach_options():

0 commit comments

Comments
 (0)