Search Shortcut cmd + k | ctrl + k
databricks

Read and write Databricks tables directly from DuckDB.

Maintainer(s): redox

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 databricks FROM community;
LOAD databricks;

Example

INSTALL databricks FROM community;
LOAD databricks;

CREATE SECRET dbx (
    TYPE databricks,
    HOST 'adb-123.azuredatabricks.net',
    WAREHOUSE_ID 'abc123',
    TOKEN 'dapi...'
);
ATTACH 'main' AS db (TYPE databricks, SECRET dbx, SCHEMA 'sales');

SELECT * FROM db.orders;

INSERT INTO db.orders
SELECT * FROM read_parquet('orders/*.parquet');

About databricks

The Databricks extension attaches one Unity Catalog catalog as a DuckDB database. Tables are read and written with ordinary DuckDB SQL through the SQL Statement Execution API. It does not read Delta files, and it does not open a Thrift session. Filters, projections, LIMIT, and ORDER BY ... LIMIT can be pushed down to the warehouse.

Features include:

  • ATTACH support for a Databricks catalog, including secrets for a personal access token or a service principal
  • reads from attached schemas and tables
  • writes with INSERT, COPY, CREATE TABLE AS, UPDATE, DELETE, and TRUNCATE
  • databricks_query and databricks_execute for Databricks SQL that DuckDB cannot express

Added Functions

function_name function_type description comment examples
databricks_clear_cache table NULL NULL  
databricks_execute table NULL NULL  
databricks_query table NULL NULL  
databricks_type_mapping scalar NULL NULL  

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
dbx_ca_cert PEM bundle to trust, or 'system' VARCHAR GLOBAL []
dbx_debug_show_queries Print each statement text and id BOOLEAN GLOBAL []
dbx_filter_pushdown Push filters into Databricks SQL BOOLEAN GLOBAL []
dbx_http_retries Retries for HTTP 429, 503, and connection errors UBIGINT GLOBAL []
dbx_http_timeout_ms Per-request HTTP timeout in milliseconds UBIGINT GLOBAL []
dbx_insert_max_statement_bytes Maximum SQL text of one INSERT statement, at most 16 MiB UBIGINT GLOBAL []
dbx_order_pushdown Push ORDER BY … LIMIT into Databricks SQL BOOLEAN GLOBAL []
dbx_statement_timeout_ms Cancel a statement still running after this many milliseconds. 0 waits UBIGINT GLOBAL []