feat(c): build a catalog-free Table from a resolved schema JSON - #595
Draft
JunRuiLee wants to merge 2 commits into
Draft
feat(c): build a catalog-free Table from a resolved schema JSON#595JunRuiLee wants to merge 2 commits into
JunRuiLee wants to merge 2 commits into
Conversation
JunRuiLee
force-pushed
the
feat/table-descriptor
branch
from
July 23, 2026 04:19
a8cb300 to
83f2db7
Compare
Allow the branch pointer of paimon_table_from_schema_json to be null,
defaulting to DEFAULT_MAIN_BRANCH ("main"). A non-null pointer still goes
through the full UTF-8 and branch-name validation, so invalid names such as
"../dev" are still rejected. Update the doc and Safety comment accordingly
and add a test covering the null-branch default.
JunRuiLee
force-pushed
the
feat/table-descriptor
branch
from
July 28, 2026 08:31
83f2db7 to
7636fda
Compare
JunRuiLee
marked this pull request as ready for review
July 28, 2026 08:33
JunRuiLee
marked this pull request as draft
July 28, 2026 08:40
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
Add a catalog-free way to build a read-only
Tablefrom an already-resolved PaimonTableSchema, so a non-Java engine (e.g. Doris FE/BE via the C FFI) can rebuild a table for scan/read without a catalog lookup.Today the only way to obtain a
TableisCatalog::get_table, which re-resolves the table — risking schema/snapshot drift versus what the planner (the FE) already resolved — and ties the reader to a filesystem-catalog layout.This is intentionally minimal and does not introduce a new cross-language DTO. An earlier iteration proposed a dedicated
TableDescriptorabstraction on the Java side to bundle path/schema/branch, but the community felt it lacked sufficient motivation: it would re-define Paimon table metadata on the Java side and couple the paimon-rust interface to Doris integration details. That approach is dropped in favor of a generic, catalog-free entry point.Design
The caller (Doris FE) passes everything a reader needs directly:
table_path— the table locationtable_schema_json— the fullTableSchemaJSON, already resolved by the FE (parsed with the existing serdeTableSchemashape; not re-loaded or overridden)database/table_name— used to synthesize the tableIdentifierbranch— selects the branch-scoped managers (schema/snapshot/tag read paths); nullable, defaults tomainstorage_options— used only to buildFileIO; they are not merged into the supplied schemaThe Rust side constructs the
Tabledirectly: noCatalog, no warehouse derivation, and no re-resolution of the FE-provided schema.branchonly decides which branch's schema/snapshot/tag paths reads follow; reads can still use FE-generated splits, and Rust-side time travel remains available through the existing read-builder options.Brief change log
crates/paimon/src/table/mod.rs:Table::from_resolved_schema(file_io, identifier, location, schema, branch)— preserves the supplied schema as-is, validates the branch name, wires a branch-scopedSchemaManager, setsrest_env = Noneand no time travel.bindings/c/src/table.rs: C FFIpaimon_table_from_schema_json(table_path, table_schema_json, database, table_name, branch, storage_options, storage_options_len), mirroring the existingpaimon_catalog_get_tablehandle/free contract, with an ABI signature guard.branchmay be null (defaults tomain); a non-null pointer is still fully UTF-8 and branch-name validated. Freed viapaimon_table_free.schema/schema-NbySchemaManager; the resolved schema pins the planned/current schema only.Tests
paimon-cFFI tests: build a table from a resolved schema JSON; null-branch defaults tomain; invalid branch name (e.g.../dev) rejected; malformed JSON rejected; null-pointer / nullstorage_optionswith non-zero length rejected.API and Format
paimon::table::Table::from_resolved_schema, and C FFIpaimon_table_from_schema_json(additive; existing symbols unchanged).TableSchemaJSON.Documentation
None yet (new, evolving C FFI surface for the Doris integration); docs can follow once the integration stabilizes.