[core][spark] Support managed Format Table partition operations#8713
Draft
sundapeng wants to merge 4 commits into
Draft
[core][spark] Support managed Format Table partition operations#8713sundapeng wants to merge 4 commits into
sundapeng wants to merge 4 commits into
Conversation
sundapeng
force-pushed
the
format-table-partition-operations
branch
from
July 18, 2026 06:24
f2a9b50 to
df367a3
Compare
This was referenced Jul 19, 2026
Member
Author
|
To make this easier to review, I have split it into three stacked PRs with identical content (the tip of the stack is byte-identical to this branch):
Converting this PR to draft and keeping it open as the full-feature view; review can start with #8728. I will close this one once the split PRs are merged. |
sundapeng
marked this pull request as draft
July 19, 2026 07:46
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.
Add list_format_table_partitions and sync_format_table_metadata procedures for catalog-managed Format Tables. Listing pages through the catalog and embeds a filter fingerprint in page tokens so stale cursors are rejected. The sync procedure diffs the filesystem against the catalog registration, defaults to dry-run, and applies repair diffs in bounded batches. MSCK REPAIR TABLE reuses the same sync engine through an interception ahead of Spark's v2 rejection, and SHOW PARTITIONS runs through a bounded, paginated executor.
Identify the Paimon REST client and its version by default (standard HTTP practice) so servers can audit callers and detect clients that predate newer table semantics. An explicit header.User-Agent option always wins, and the header is outside the DLF signature set.
sundapeng
force-pushed
the
format-table-partition-operations
branch
from
July 19, 2026 11:43
2b6e714 to
be718a8
Compare
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.
Summary
Follow-up to #8707. This PR makes the catalog the source of truth for opt-in managed Format Table partitions and wires the complete partition lifecycle through Core and Spark SQL.
Changes
.and.., and prevent managed table copies from switching partition-path layouts dynamically.ADD/DROP PARTITION,SHOW PARTITIONS, andMSCK REPAIR TABLE ... [ADD|DROP|SYNC] PARTITIONSin Spark. Partial DROP specs use bounded catalog paging and deduplicated scans.sys.list_format_table_partitionswith bounded filtered pagination. Continuation tokens are bound to the originalwherepredicate and fail closed if a replayed raw catalog page changes.sys.sync_format_table_metadatawith dry-run support, scoped filesystem/catalog reconciliation, raw partition-value preservation, paged catalog traversal, and bounded mutation batches.Testing
FormatTableMetadataProcedureTest(36 tests)Notes
metastore.partitioned-table=trueand require a catalog that advertises the capability (currently REST catalog).whereexpression.Relates to #8707.