[spark] Support managed Format Table partition DDL - #8729
Closed
sundapeng wants to merge 2 commits into
Closed
Conversation
This was referenced Jul 19, 2026
Route managed Format Table partition discovery through the catalog so scans read exactly the registered partitions and an empty registration reads as empty instead of falling back to directory listing. Validate partition locations against the table path before any read or delete. Register written partitions at commit time in bounded batches, keep IF NOT EXISTS registration idempotent for concurrent writers, and fall back to unmanaged directory discovery when no catalog manages the table.
Route ALTER TABLE ADD/DROP PARTITION for catalog-managed Format Tables through a Spark-side partition gateway. ADD forwards the whole batch with the IF NOT EXISTS flag so the catalog can apply it atomically and creates partition directories; strict batch atomicity stays with the catalog service. DROP unregisters partitions before deleting their directories, expands partial specs through bounded catalog pagination, and never touches data that is not registered. Session-level overrides of the managed flag are ignored when classifying tables, and unmanaged Format Tables fail with an explicit unsupported error.
sundapeng
force-pushed
the
split-v4/format-table-managed-spark-ddl
branch
from
July 19, 2026 11:43
ab95cea to
eb47e82
Compare
Member
Author
|
Closing in favour of a re-split of this work. The implementation changed enough since this split that updating the branch in
The review comments here are all addressed; the new PRs describe how. Replaced by: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relationship
Second part of splitting #8713; stacked on the core part #8728 (the diff shown here includes
the core commit until that PR merges — please review only the
[spark] Support managed Format Table partition DDLcommit). Marked draft until the core part lands.Purpose
Spark SQL partition DDL for managed Format Tables on top of the core part:
ALTER TABLE ... ADD/DROP PARTITIONbacked by the catalog.Main changes
FormatTablePartitionCatalog) wired intoPaimonFormatTable;DDL executes against the catalog, not the filesystem.
visible and writable). Partition values are validated against path escapes
(
./.., resolved path must stay under the table root);ADD ... LOCATIONisrejected (managed table locations are derived).
a full spec that is not registered fails without touching its directory (protects
data awaiting registration). Partial specs expand through the catalog to leaf
partitions; expansions and unregistrations run in bounded batches.
the catalog service — the client forwards
IF NOT EXISTSunchanged and skips Spark'sclient-side existence precheck.
metastore.partitioned-tableoverrides are ignored with a WARN (thepersisted table property wins) instead of failing table loads.
Tests
DDL planning with a fault-injection catalog (26), partition management round-trips (20),
gateway contract tests incl. mutation batching (6), option handling (5). Partial-spec DROP expansion lists partitions unfiltered and matches client-side — no server-side prefix pushdown in this first version.