Search Shortcut cmd + k | ctrl + k
delta_export

Export DuckLake catalog tables to Delta Lake format

Maintainer(s): djouallah

Compatibility Matrix

This table covers all DuckDB releases that have not reached end-of-life, including LTS releases, and shows the 2 most recent patch releases of each. Older patch releases are not listed, but the extension may be available for them as well.

Platform 1.4.4 1.4.5 1.5.5 1.5.6 2.0.0
Linux AMD64
Linux ARM64
macOS AMD64
macOS ARM64
Windows AMD64
Windows ARM64
WebAssembly

Installing and Loading

INSTALL delta_export FROM community;
LOAD delta_export;

Example

-- Load required extensions
LOAD ducklake;
LOAD delta_export;

-- Attach a DuckLake catalog
ATTACH 'ducklake:metadata.ducklake' AS lake (DATA_PATH '/path/to/data');
USE lake;

-- Create and populate a table
CREATE TABLE orders (id INTEGER, amount DOUBLE);
INSERT INTO orders VALUES (1, 99.99), (2, 149.50);

-- Export all DuckLake tables to Delta Lake format
CALL delta_export();

-- Or export only some tables or schemas
CALL delta_export(tables := ['main.orders']);  -- or schemas := ['sales']

About delta_export

Delta Export reads DuckLake internal metadata and writes Delta Lake checkpoint files (Parquet, JSON transaction log, and _last_checkpoint) for each table in the catalog.

This enables interoperability between DuckLake-managed data and any system that reads Delta Lake format, such as Apache Spark, Databricks, Microsoft Fabric, and other Delta-compatible engines.

Deletes, updates and MERGE are exported as Delta deletion vectors, so no file rewrite is needed. Each export commits the next Delta version, widened columns use the Delta typeWidening feature, and the Delta log of a dropped table is removed.

Works with both DuckDB and SQLite-backed DuckLake catalogs, and supports all storage backends including local filesystem and ABFSS.

Added Functions

function_name function_type description comment examples
delta_export table Exports every table of the DuckLake catalog in use (or the first attached lake) to Delta Lake by writing _delta_log metadata over the existing parquet files, with deletes as deletion vectors; also removes the Delta logs of dropped tables. With tables := ['name', 'schema.name'] and/or schemas := ['schema'] only those tables, and every table of those schemas, are exported, and dropped-table logs are removed only in those schemas. Returns one status row per table. NULL [CALL delta_export();, CALL delta_export(tables := ['main.orders']);, CALL delta_export(schemas := ['sales'], tables := ['main.orders']);, SELECT table_name, status, data_snapshot FROM delta_export();]

Overloaded Functions

This extension does not add any function overloads.

Added Types

This extension does not add any types.

Added Settings

name description input_type scope aliases typed_value
temp_directory Set the directory to which temporary files are written. VARCHAR GLOBAL [] post.db.tmp