Skip to content

feat: PARTITIONED BY in a Unity Catalog CREATE TABLE - #143

Merged
benfleis merged 3 commits into
mainfrom
feat/uc-create-external
Oct 15, 2026
Merged

benfleis merged 3 commits into
mainfrom
feat/uc-create-external

Conversation

@benfleis

@benfleis benfleis commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

CREATE TABLE … PARTITIONED BY (…) now works in a Unity Catalog schema: the
table is written partitioned, and UC registers the partition columns.

WITH (location = …) asks for an external table, which is not supported yet;
it now fails with an error that says so. Other WITH options and SORTED BY
stay refused.

DuckDB's base catalog rejects any WITH clause, SORTED BY and PARTITIONED BY before a bind
finishes, so a Unity Catalog table could never be asked for by anything but its columns. The
catalog now decides for itself:

- `location`, the option that asks for an external table, is accepted through the bind and
  refused in the create path with what it would have meant. The external path is not built yet;
  this is what the user sees until it is.
- PARTITIONED BY is allowed through. The partition columns reach the Delta writer and are
  registered with the table, so a partitioned managed table now works end to end.
- Any other option is refused by name rather than carried into the create, where the catalog and
  the kernel each have their own view of what a property may be. SORTED BY keeps the base
  catalog's refusal.

Option keys arrive lowercased from the parser, and both checks rely on that rather than one
comparing case-insensitively and the other exactly -- the combination would have silently
ignored a location.

The new test pins each refusal, including the two that could only ever come from here. Its
driver and create_table.py's now pass the catalog in explicitly: only a test that provisions
resources exports it, so a body that relied on that skipped or passed depending on what ran
before it.
…s one through

PARTITIONED BY reaches the Delta writer once the catalog stops refusing it, and nothing checked
what it produced. A partitioned table is now created, written across two partitions and read back,
and the driver checks over UC's REST API that the partition column was registered as one -- the
part no query through DuckDB can see.

Also in the options test:

- The header is whole again: the description had been split around its `group:` line.
- The table-property case says what the code does -- every option but `location` is refused --
  instead of describing a rule for protocol properties alone.
- The driver takes the server's address from the fixture, so an attached server works without
  UC_ENDPOINT.
@benfleis
benfleis force-pushed the feat/uc-create-external branch from 544e4d5 to 8028e14 Compare October 15, 2026 17:14
@benfleis benfleis changed the title Feat/uc create external feat: PARTITIONED BY in a Unity Catalog CREATE TABLE Oct 15, 2026
@benfleis
benfleis merged commit 027a35d into main Oct 15, 2026
13 checks passed
@benfleis
benfleis deleted the feat/uc-create-external branch October 15, 2026 20:42
@benfleis
benfleis restored the feat/uc-create-external branch October 15, 2026 22:09

This branch was successfully deployed

1 active deployment
cloud — 8028e14d Deployed Oct 15, 2026 by benfleis via Cloud (Databricks) #126
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant