duckdb / duckdb_delta

DuckDB extension for Delta Lake
MIT License
88 stars 8 forks source link

DuckDB Delta Extension

This is the experimental DuckDB extension for Delta. It is built using the (also experimental) Delta Kernel. The extension (currently) offers read support for delta tables, both local and remote.

Supported platforms

The supported platforms are:

Support for the other DuckDB platforms is work-in-progress

How to use

NOTE: this extension requires the DuckDB v0.10.3 or higher

This extension is distributed as a binary extension. To use it, simply use one of its functions from DuckDB and the extension will be autoloaded:

FROM delta_scan('s3://some/delta/table');

Note that using DuckDB Secrets for S3 authentication is supported:

CREATE SECRET (TYPE S3, provider credential_chain);
FROM delta_scan('s3://some/delta/table/with/auth');

To scan a local table, use the full path prefixes with file://

FROM delta_scan('file:///some/path/on/local/machine');

Features

While still experimental, many (scanning) features/optimizations are already supported in this extension as it reuses most of DuckDB's regular parquet scanning logic:

More features coming soon!

Building

See the Extension Template for generic build instructions

Running tests

There are various tests available for the delta extension:

  1. Delta Acceptence Test (DAT) based tests in /test/sql/dat
  2. delta-kernel-rs based tests in /test/sql/delta_kernel_rs
  3. Generated data based tests in tests/sql/generated (generated using delta-rs, PySpark, and DuckDB)

To run the first 2 sets of tests:

make test_debug

or in release mode

make test

To also run the tests on generated data:

make generate-data
GENERATED_DATA_AVAILABLE=1 make test