Repository navigation
feat(table): read the registered partitions of a catalog-managed format table - #814
Merged
JingsongLi merged 3 commits intoSep 11, 2026
Merged
Conversation
sundapeng
force-pushed
the
feat/format-table-catalog-managed-scan
branch
from
September 11, 2026 05:42
3e48c05 to
079ee84
Compare
…at table Split out of apache#591. A Format Table loaded from a REST catalog with metastore.partitioned-table=true has its partitions managed by the catalog: the registrations, not the directory tree, decide what a scan reads. - RESTEnv keeps the partition settings the catalog returned when the table was loaded (table path, file format, path layout), and loading an external or engine-implemented table with managed partitions fails. Dynamic options cannot switch the partition source, the path layout or the implementation of such a table. - The format table scan lists the registered partitions instead of directories. It sends the catalog a partition-name pattern built only from leading CHAR/VARCHAR equalities, whose values have one spelling, and the partition predicate through list-by-filter, keeping the conjuncts of an AND that have a wire form. A catalog answering 501 for the filter is asked by pattern; the directory tree is never used. Registered values accept the Java boolean spellings, and a partition registered at a custom location fails the scan instead of reading the table directory in its place. - RESTCatalog no longer falls back to a file system listing for a table with catalog-managed partitions when the partition endpoints answer 501. - Partition values and path names go through shared helpers, which escape path names the way Java and PartitionComputer do: a non-ASCII value in a leading-equality or value-only path is no longer percent-encoded.
Covers SELECT over a Format Table whose partitions a mock REST catalog manages, with the partitions registered through the catalog API: only registered partitions are read, the partition-name pattern and the list-by-filter request carry what the scan pushes down, a 501 from list-by-filter is retried by pattern, registrations spelled unlike the filter are still read, filters on partition columns see the registered value, a partition at a custom location fails the query, and a catalog that cannot list partitions fails it instead of letting it read directories. The tests share the paimon crate's mock REST server, which brings axum in as a dev-dependency.
sundapeng
force-pushed
the
feat/format-table-catalog-managed-scan
branch
from
September 11, 2026 06:32
079ee84 to
601f175
Compare
sundapeng
marked this pull request as ready for review
September 11, 2026 06:33
JingsongLi
reviewed
Sep 11, 2026
JingsongLi
reviewed
Sep 11, 2026
…able options RESTEnv kept a copy of the Format Table partition settings the catalog returned at load time, so that dynamic options could not switch where partitions come from or how their paths are laid out. Java keeps no such copy: FormatTable.copy compares the persisted options with the merged ones and refuses the change. Do the same. RESTEnv goes back to being the REST commit context. Table::has_catalog_managed_partitions and the scan read the settings from the table options, and copy_with_time_travel refuses dynamic options that change metastore.partitioned-table or, for a table with catalog-managed partitions, its path layout, engine implementation, type, path or file format. Java fixes the last three when the table is loaded; this table reads them from its options, so they are guarded here. The strict option readers and their enum go with it: the two options still consulted are read like the neighbouring CoreOptions readers.
jerry-024
added a commit
to jerry-024/paimon-rust
that referenced
this pull request
Sep 14, 2026
…em-table * upstream/main: feat(datafusion): support ANALYZE TABLE on catalog-managed format tables (apache#815) refactor(table): unify vector search scan and read APIs (apache#822) fix(rest): sign the query string the client actually sends (apache#821) feat(datafusion): add MSCK REPAIR TABLE for catalog-managed format tables (apache#817) feat(table): execute a primary-key vector search over engine-planned splits (apache#771) feat(datafusion): add SHOW, ADD and DROP PARTITION for catalog-managed format tables (apache#816) feat(table): read the registered partitions of a catalog-managed format table (apache#814) fix: report unsupported time travel instead of returning current data (apache#753) fix(file_index): skip pruning for narrowing integer schema changes (apache#806) fix(c): align append vector filter with core behavior (apache#793) fix(table): skip staging files and list format table partitions concurrently (apache#813) feat(rest): add partition registration, lookup and statistics APIs (apache#812) fix(datafusion): keep format table partition columns out of decoder filters (apache#811) fix(read): null-fill nested fields a data file predates (apache#805) fix(scan): prune NOT IN predicates using file stats (apache#795) fix(spec): accept the legacy first_not_null_value aggregate name (apache#794) fix(table): check batch arity instead of asserting it in debug builds (apache#801) fix(vindex): bound a deletion-vector position by its own source file (apache#802) fix(lumina): decide on the index size before parsing the metric (apache#803) # Conflicts: # crates/integrations/datafusion/src/physical_plan/scan.rs
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.
Purpose
Split out of #591 so it can be reviewed on its own. A Format Table loaded from a REST catalog with
metastore.partitioned-table=truehas its partitions managed by the catalog: the registrations, not the directory tree, decide what a scan reads. This PR makes the Rust scan read exactly those partitions. The SQL statements that administer them (SHOW/ADD/DROP PARTITION,MSCK REPAIR TABLE) andANALYZE TABLEfollow in later PRs.Its prerequisites #811, #813 and #812 have all merged, so this PR now contains only its own two commits.
Brief change log
RESTEnvkeeps the Format Table partition settings the catalog returned when the table was loaded: table path, file format and path layout. Loading an external table or anengine-implemented table with catalog-managed partitions fails. Dynamic options cannot switch the partition source, the path layout or the implementation of such a table.Table::has_catalog_managed_partitionsreports whether a table is one.month = 1never filters out a partition registered asmonth=01;list-by-filter(Predicate::to_rest_json); an AND keeps the conjuncts that have a wire form, anything else goes whole or not at all;options.path, [api][core][spark] Support custom partition locations paimon#9540) fails the scan instead of reading the table directory in its place.RESTCatalog::list_partitionsandlist_partitions_pagedreturn the 501 error for a table with catalog-managed partitions instead of falling back to a file system listing.list_partitions_by_namesfalls back tolist_partitions, so it inherits that.PartitionComputerescape them, so a non-ASCII value in a leading-equality or value-only path is no longer percent-encoded.Tests
format_partition::tests: value parsing and formatting, Java boolean spellings, partition names and relative paths per layout, name-pattern construction and refusals.format_table_scan::tests: whatpartition_filter_jsonsends, and leading-equality path escaping.core_options::tests,partition_utils::tests: the strict option readers andunescape_path_name.rest_catalog_test.rs: loading and rejecting catalog-managed tables, dynamic option validation, a scan that reads each registered partition once and a missing registered directory as empty, a listing error and malformed metadata failing the scan, and the 501 policy of the catalog listings.crates/integrations/datafusion/tests/rest_format_table_scan.rs, with partitions registered through the catalog API: only registered partitions are read, the pattern andlist-by-filterrequest contents, the 501 retry by pattern, registrations spelled unlike the filter, filters on partition columns, the custom-location refusal, and a catalog that cannot list partitions failing the query.Commands run on the top commit:
fmt, clippy,
paimon(2937 tests) andpaimon-rest-server(10) pass. Locally, 39paimon-datafusiontests fail because they read fixture tables provisioned bymake docker-up(two also need the lumina native library); the same 39 fail by name onmainin this environment, and everything else passes, including the new scan tests.API and Format
Table::has_catalog_managed_partitions.RESTCatalogpartition listings no longer fall back to the file system for tables with catalog-managed partitions.paimon-datafusiongainsaxumas a dev-dependency for the shared mock REST server.The storage format is unchanged.
Documentation
None yet: the SQL documentation for catalog-managed Format Table partitions comes with the partition commands PR.