Skip to content

Reading Delta Lake tables from DuckDB through Unity Catalog

Preetham ReddyUpdated 6 min readVoices

On 21 October we tested DuckDB against the Unity Catalog tables in our own Azure metastore. It failed without reading a single row, mostly because of where Databricks keeps the files. Of our 32 managed tables, 21 sat on default storage, which Unity Catalog won't open to any outside engine. The other 11 carried governance settings the routes we planned couldn't read: catalog-managed commits or row filters. We ran the test before writing any product code, and parked the plan the same day.

For a company on Databricks, that's a constraint worth knowing before anyone promises it away. New workspaces put tables on default storage unless somebody chooses otherwise. A partner's tools, a cheaper query engine or an AI agent on a laptop can't read a table there directly, whatever permissions the person holds. Governance stays simple, but every outside read has to go through the platform's own compute or a sharing product.

We'd gone looking because of Fabric Agents, the app we built for working with AI agents. It already ships DuckDB 2.0. An agent that needs a number from a Unity Catalog table goes through a SQL warehouse today, with its cold start and per-query cost. Reading the files straight from storage would answer "orders last week by region" in seconds with no warehouse running. That's why we tested it on our own tables first. The same storage question decides the other DuckDB idea for Delta Lake, a catalog file of views handed to outside partners.

What we tried, and what Unity Catalog said

An outside engine reads a Unity Catalog table by asking Unity Catalog for a short-lived storage credential scoped to that table, which Databricks calls credential vending (credential vending). Vending has to be switched on for the whole metastore, and each schema needs an explicit EXTERNAL USE SCHEMA grant, which isn't part of ALL PRIVILEGES and isn't held by schema owners by default (enable external access).

It was off on both metastores we tried. Our Azure metastore answered "External Data Access from non Databricks Compute environment is disabled for metastore", and on a Free Edition workspace on AWS the metastore belongs to Databricks, so we couldn't switch it on at all. The Iceberg REST endpoint on that AWS workspace did accept DuckDB's ATTACH with a user OAuth token and listed the catalog's schemas and tables, which proved the sign-in path and nothing more.

On Azure we enabled external access for the test and granted the schema permission. Unity Catalog then refused every table on default storage by its kind:

Only 'TABLE_EXTERNAL', 'TABLE_DELTA_EXTERNAL' and 'TABLE_DELTA' table kinds can be accessed externally

Our tables were TABLE_DB_STORAGE, and schemas on default storage refused the EXTERNAL USE SCHEMA grant as well. We reverted both settings afterwards, and the whole test cost API calls and no compute.

That's the limit to know before designing anything here. Default storage is the default for new workspaces and for serverless, so a company that set up Databricks recently probably has most of its tables where no outside engine can reach them.

Unity Catalog table

Files on Databricks default storage

Files on your own storage

Refused: no credential for outside engines

Row filters or column masks

Catalog-managed commits

Plain managed or external table

Untried: DuckDB's Unity Catalog extension

Readable with a vended credential

Which Unity Catalog tables the routes we tested could read from DuckDB, by where the files live and how the table is governed.

The tables an outside engine can read

What's left after default storage is narrower than it sounds. Vending refuses tables with row filters or column masks, views, materialized views and streaming tables. DuckDB refuses direct reads of Delta tables with the catalogManaged feature, because their commits need the catalog (DuckDB Delta extension). DuckDB's separate Unity Catalog extension does handle catalog-managed commits by attaching the catalog itself (Unity Catalog extension), and that's a route we didn't try. It still needs its own credential for the table's storage, so default storage blocks it in the same place. Reading a Delta table through the Iceberg endpoint needs Iceberg reads switched on for that table, and without it Unity Catalog says the table "is not an Iceberg compatible table". DuckDB's Iceberg catalogs support S3 and GCS storage only for now, so on Azure the route would be a vended credential per table and a view over delta_scan, which we never got far enough to test.

So on the routes we tested, the readable table is plain managed or external Delta on the company's own storage, with no governance filters on it. None of ours qualified, and the governed tables a business cares most about are the ones most likely to carry row filters.

A catalog of views for outside partners

The idea DuckDB wrote up on 7 October (A DuckDB Database with No Data in It) is a database file that holds no rows at all, only view definitions over Delta Lake, which each recipient attaches read-only. It suits a company that owes a weekly dataset to a dozen distributors and today sends them logins into its analytics estate or a folder of CSVs that nobody can vouch for after a quarter. A view over a shipments table would look like this.

CREATE OR REPLACE VIEW shipments AS
    SELECT ship_date, plant_id, sku, qty_shipped
    FROM delta_scan('s3://example-lake/gold/shipments');

The view is the contract. When the files move or a column is renamed, the publisher replaces the view and uploads the file again, and the distributors' queries keep working. Over HTTPS or the S3 API the file is read-only, DuckDB's post says, so every change is a deliberate publish.

DuckDB's own write-up states the condition only in general: every recipient needs read access to every location the views point at. Our test shows what that means on default storage. On default storage that access doesn't exist for anyone outside Databricks, so a view-only catalog over those tables would attach cleanly and fail on the first query. A company in that position would publish the dataset to its own storage with a Databricks job first, or use Delta Sharing, which was built for handing governed data to outside parties.

Per-recipient rules are the other limit. A published catalog shows the same view of the world to whoever holds it, so different rows for different distributors means separate files and separate credentials, which stops being practical as the list of recipients grows.

Where it stands

Parked. We'd revisit the agent feature if Databricks opens default storage to outside engines, and we'd try DuckDB's Unity Catalog extension on the catalog-managed tables we keep on our own storage before deciding about them. Before building anything, we'd ask how many of the workspaces it's meant for keep plain, unfiltered tables on their own storage. On ours, 11 tables were on our own storage and none of them fitted the routes we tested.

The check we'd run first on a client's workspace takes an afternoon. List each table the feature or the catalog would use, with its table kind, its storage location, whether it's catalog-managed and whether it has row filters, and see how many survive. Our Unity Catalog work covers the governance side, and our data integration work covers publishing a dataset somewhere partners can read it.

Frequently asked questions

Why can't DuckDB read a table on Databricks default storage?

Unity Catalog only vends storage credentials for tables of kind TABLE_EXTERNAL, TABLE_DELTA_EXTERNAL or TABLE_DELTA, and tables on default storage are TABLE_DB_STORAGE. Schemas on default storage also refuse the EXTERNAL USE SCHEMA grant. So no engine outside Databricks gets a credential for them, DuckDB included, whatever the user's own permissions are.

Which settings does an admin change before an outside engine can read Unity Catalog?

External data access has to be switched on for the metastore, which affects every catalog in it, and each schema needs an explicit EXTERNAL USE SCHEMA grant. On a Free Edition workspace the metastore belongs to Databricks, so it can't be switched on there. Even with both in place, vending still refuses tables with row filters or column masks.

How is a view changed after recipients have attached the catalog file?

Edit a local copy and upload it again, because the file can't be changed in place over HTTPS or S3. When a prefix moves or a column is renamed, CREATE OR REPLACE VIEW points the view at the new location or aliases the column back, so the recipients' queries don't change. The file holds no rows, so it stays small however large the data gets.