The most efficient way to query Delta Lake tables directly from DuckDB via the Delta Sharing protocol.
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 duckdb_delta_sharing FROM community;
LOAD duckdb_delta_sharing;
Example
INSTALL duckdb_delta_sharing FROM community;
LOAD duckdb_delta_sharing;
-- Required for network access
INSTALL httpfs;
LOAD httpfs;
-- Basic Configuration
-- Set your sharing endpoint and bearer token using DuckDB Secrets:
CREATE SECRET (
TYPE delta_sharing,
PROVIDER config,
ENDPOINT 'https://your-delta-sharing-server.com/api/2.0/delta-sharing',
BEARER_TOKEN 'your_private_token'
);
-- Alternatively, if you have DELTA_SHARING_ENDPOINT and DELTA_SHARING_BEARER_TOKEN set in your environment:
CREATE SECRET (TYPE delta_sharing, PROVIDER env);
-- Discovering Content
SELECT * FROM delta_share_list(); -- shares
SELECT * FROM delta_share_list('my_share'); -- schemas in a share
SELECT * FROM delta_share_list('my_share', 'my_schema'); -- tables in a schema
SELECT * FROM delta_share_list_all_tables('my_share'); -- every table across all schemas
SELECT * FROM delta_share_list('my_share', 'my_schema', 'my_table');-- a table's columns
-- Reading Tables
SELECT * FROM delta_share_read('my_share', 'my_schema', 'my_table')
WHERE year = 2024
LIMIT 100;
-- Time Travel
SELECT count(*)
FROM delta_share_read('my_share', 'my_schema', 'my_table', '2024-04-09 12:00:00');
-- Change Data Feed (CDF)
SELECT *
FROM delta_share_change_data_feed('my_share', 'my_schema', 'my_table', 10);
About duckdb_delta_sharing
duckdb_delta_sharing is an extension for querying Delta Lake tables directly from DuckDB. It implements the Delta Sharing protocol, allowing you to stream data from remote Delta Sharing servers with native performance.
Capabilities:
-
Ultra-Fast Native Reader: Built directly on DuckDB's
MultiFileReaderand C++ Parquet scanner. No Python overhead. - Variant Type: The VARIANT data type stores semi-structured data in binary format.
- Time Travel: Query your data as it existed at any point in history.
- Change Data Feed (CDF): Easily track incremental additions, removals, and updates.
- Advanced Predicate Pushdown: Filters are pushed to the server to minimize data transfer.
- Secure by Design: Supports OAuth/Bearer token authentication and industry-standard encryption.
- Query Telemetry: Optional SQL tracking to help administrators optimize performance.
Architecture: Traditional Delta Sharing clients often rely on heavy frameworks like Spark. This extension allows DuckDB to pull Parquet files directly into its memory. It natively handles partition discovery (automatically mapping folder structures to columns), deletion vectors (row-level deletes without rewriting files), and schema evolution (safely mapping Delta types to DuckDB's native types).
Added Functions
| function_name | function_type | description | comment | examples |
|---|---|---|---|---|
| delta_share_change_data_feed | table | Query Change Data Feed (CDF) changes for a Delta table starting from a specific version or timestamp. | NULL | [SELECT * FROM delta_share_change_data_feed('my_share', 'my_schema', 'my_table', 10);] |
| delta_share_change_data_feed | table | Query Change Data Feed (CDF) changes for a Delta table starting from version 0. | NULL | [SELECT * FROM delta_share_change_data_feed('my_share', 'my_schema', 'my_table');] |
| delta_share_change_data_feed | table | Query Change Data Feed (CDF) changes for a Delta table within a version or timestamp range. | NULL | [SELECT * FROM delta_share_change_data_feed('my_share', 'my_schema', 'my_table', 10, 20);] |
| delta_share_list | table | List shares, schemas in a share, tables in a schema, or columns in a table from a Delta Sharing server. | NULL | [SELECT * FROM delta_share_list();] |
| delta_share_list_all_tables | table | List all tables across all schemas in a Delta Sharing share. | NULL | [SELECT * FROM delta_share_list_all_tables('my_share');] |
| delta_share_list_files | scalar | Return a list of storage file URLs for a Delta table from a Delta Sharing server. | NULL | [delta_share_list_files('my_share', 'my_schema', 'my_table')] |
| delta_share_list_files | scalar | Return a list of storage file URLs for a Delta table matching SQL predicate hints. | NULL | [delta_share_list_files('my_share', 'my_schema', 'my_table', 'date >= ''2024-01-01''')] |
| delta_share_read | table | Read a remote Delta Lake table via Delta Sharing as a DuckDB table. | NULL | [SELECT * FROM delta_share_read('my_share', 'my_schema', 'my_table');] |
| delta_share_read | table | Read a remote Delta Lake table via Delta Sharing as of a specific historical timestamp. | NULL | [SELECT * FROM delta_share_read('my_share', 'my_schema', 'my_table', TIMESTAMP '2024-04-09 12:00:00');] |
| delta_share_read | table | Read a remote Delta Lake table via Delta Sharing as of a specific historical timestamptz. | NULL | [SELECT * FROM delta_share_read('my_share', 'my_schema', 'my_table', TIMESTAMPTZ '2024-04-09 12:00:00Z');] |
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 |
|---|---|---|---|---|---|
| delta_sharing_max_pages | Most pages a Delta Sharing listing or query may take before it fails (0 = no limit) | UBIGINT | GLOBAL | [] | 1000 |
| delta_sharing_query_telemetry_enabled | Enable sending full SQL query to server for telemetry | BOOLEAN | GLOBAL | [] | false |
| temp_directory | Set the directory to which temporary files are written. | VARCHAR | GLOBAL | [] | post.db.tmp |