Databricks SQL Connector
Run Databricks SQL queries with OAuth2 M2M and stream results into tables.
Submits parameterized SQL to Databricks SQL Warehouses via OAuth2 M2M and the Statement Execution API. Polls async jobs and streams JSON chunks into versioned tables.
What Databricks SQL Connector does
The connector binds workspace origin, warehouse_id, and encrypted OAuth2 secrets once at the organization level. Each dataset source only needs its read-only SQL statement and quality rules.
Results flow through DuckDB SQL transforms and checks, then serve as Parquet or CSV downloads, REST endpoints, and MCP queries.
Input & output example
Shows async statement submission and paginated chunk stitching from the API.
Databricks source statement
SELECT account_id, fiscal_quarter, arr_usd FROM analytics.gold_customer_arr WHERE fiscal_quarter >= '2025-Q1'
Materialized table snapshot
| account_id | fiscal_quarter | arr_usd |
|---|---|---|
| acct_4019 | 2026-Q3 | 148500.00 |
| acct_4020 | 2026-Q3 | 92400.00 |
How it works
- 1
Enroll Databricks OAuth2 connection once
Set workspace origin, client_id, warehouse_id, and encrypted secret in Workspace Connections.
- 2
Submit and poll Statement Execution API
Fetch /oidc/v1/token, post to /api/2.0/sql/statements, poll status, and download /result/chunks/{chunk}.
- 3
Transform and serve tables
Map positional columns in DuckDB SQL, apply quality checks, and publish via Parquet, REST API, and MCP.
Try with an agent
Pre-loads Databricks SQL in chatPublish a Databricks Unity Catalog table
Pull daily regional revenue from my Databricks SQL connection, check non-null account keys, and enable Parquet export.
Join Lakehouse shipments with satellite port traffic
Extract port origin volumes from my Databricks SQL connection and join with satellite congestion metrics in DuckDB SQL.
Common use cases
- Publishing curated Unity Catalog metrics to customers or partners
- Enriching Lakehouse extracts with public macro or satellite tables
- Automating scheduled Lakehouse snapshots with no exposed credentials
- Serving clean Parquet exports and MCP access over query results
Details
- Category
- Connectors
- Identifier
- databricks-sql
- Inputs
- Databricks SQL Warehouse · OAuth2 M2M client credentials · JSON_ARRAY chunks
- Outputs
- Typed SQL & Parquet tables · Public or workspace views
- Dataset delivery
- Parquet · CSV · JSON · SQL · REST API · MCP
Frequently asked questions
How does Databricks SQL Connector authenticate?
It uses OAuth2 M2M client credentials exchanged at /oidc/v1/token with secrets stored in Workspace Secrets.
Does it handle long-running Databricks SQL statements?
Yes. It submits asynchronously, polls /api/2.0/sql/statements/{job_id} until SUCCEEDED, and fetches all chunk pages.
Are Databricks connection secrets visible to dataset readers or in chat?
No. Credentials stay isolated in the vault and never appear in prompts or public views.