Skip to content

spark: wire DRC createTable#6673

Draft
TimothyW553 wants to merge 5 commits into
delta-io:masterfrom
TimothyW553:stack/drc-createtable-catalog
Draft

spark: wire DRC createTable#6673
TimothyW553 wants to merge 5 commits into
delta-io:masterfrom
TimothyW553:stack/drc-createtable-catalog

Conversation

@TimothyW553
Copy link
Copy Markdown
Collaborator

@TimothyW553 TimothyW553 commented Apr 25, 2026

🥞 Stacked PR

Use this link to review incremental changes.


Which Delta project/connector is this regarding?

Spark / Unity Catalog Delta REST Catalog.

Description

This wires Delta REST Catalog managed CREATE TABLE into the Spark Delta catalog path.

Flow:

  1. prepareCreateTable calls the UC DRC staging API for eligible managed creates and gets the UC-managed table location plus required Delta properties.
  2. Delta writes the initial transaction log at that staged location.
  3. createTable runs after the commit and finalizes the UC table using the committed Snapshot metadata: schema, partition columns, protocol, table properties, and location.

This PR only intercepts managed CREATE shapes without an explicit user location. External create support is added in the next stack PR. Existing paths stay unchanged because the DRC path is gated on Unity Catalog, DRC being enabled and supported, no existing table, a create operation, and prepareCreateTable returning Some.

CreateDeltaTableCommand.createTableFunc now receives (CatalogTable, Snapshot) so the DRC finalization step can use the post-commit Delta metadata instead of pre-commit table input.

How was this patch tested?

Added Spark catalog and schema-converter coverage for the managed create flow, including staging success, unsupported create shapes, disabled/unavailable DRC, staging errors, table-id mismatch, safety-net create failure, createTable request body/namespace assertions, protocol feature ordering, property filtering, and Spark-to-DRC schema conversion.

Ran:

build/sbt 'spark/testOnly org.apache.spark.sql.delta.catalog.DeltaCatalogClientSuite org.apache.spark.sql.delta.catalog.DeltaRestSchemaConverterSuite'

Result: 23 tests passed.

Does this PR introduce any user-facing changes?

No released-version user-facing change. This adds internal plumbing for DRC-backed managed table creation when the experimental catalog option is enabled.

@TimothyW553 TimothyW553 force-pushed the stack/drc-createtable-catalog branch from 320b463 to 2df9bb0 Compare April 26, 2026 00:47
@TimothyW553 TimothyW553 changed the title spark: wire DRC managed createTable spark: wire DRC createTable Apr 26, 2026
@TimothyW553 TimothyW553 force-pushed the stack/drc-createtable-catalog branch 7 times, most recently from f38f01b to 22e0c54 Compare April 26, 2026 08:19
@TimothyW553 TimothyW553 force-pushed the stack/drc-createtable-catalog branch 16 times, most recently from 4bbc9a7 to f266794 Compare April 27, 2026 20:05
@TimothyW553 TimothyW553 force-pushed the stack/drc-createtable-catalog branch 7 times, most recently from 303f5bd to fbe7989 Compare May 12, 2026 18:39
@TimothyW553 TimothyW553 force-pushed the stack/drc-createtable-catalog branch 16 times, most recently from 7597846 to 439c03f Compare May 14, 2026 06:49
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