Repository navigation
feat(table): make Table a resolved handle and the home of operator creation - #434
Merged
Merged
Conversation
lucasfang
marked this pull request as draft
October 15, 2026 01:18
lucasfang
force-pushed
the
dev29
branch
2 times, most recently
from
October 19, 2026 01:56
dffd3b7 to
526e68a
Compare
lucasfang
marked this pull request as ready for review
October 19, 2026 01:57
lucasfang
force-pushed
the
dev29
branch
2 times, most recently
from
October 19, 2026 06:09
0f8f220 to
ad4b142
Compare
lxy-9602
reviewed
Oct 19, 2026
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
Linked issue: close #441
Tableheld only a schema, an identifier and a UUID: the resolutionCatalog::GetTable()had just performed — which file system serves the table, where its root is — was discarded at the door. The four operator builds (about 1400 lines in four separate.cppfiles) each re-derived the table's components from a context,Table::NewXxxwere thin forwarders to the staticCreates, andTable::Createread the schema through aSchemaManagerit then threw away, so every operator re-read the same schema file through a manager of its own.Changes:
include/paimon/catalog/table.h:Tablenow carries the per-table file system, root path, schema, identifier, UUID, and schema/snapshot managers bound to that file system, root path and branch. New accessorsGetFileSystem(),GetRootPath(),GetSchemaManager(),GetSnapshotManager(),CurrentBranch(); the constructor takes(file_system, root_path, schema, identifier, uuid, schema_manager).include/paimon/type_fwd.hgains theSchemaManager/SnapshotManagerforward declarations.src/paimon/core/table/table.cppplus the new internal headersrc/paimon/core/table/table_operators.h: the four operator builds move here verbatim behindCreateTableScan/CreateTableRead/CreateFileStoreWrite/CreateFileStoreCommit. The four operator.cppfiles shrink to forwarders, andTable::NewScan/NewRead/NewWrite/NewCommitroute through the same functions — one build path, with the table as the entry point.Table::Createreads the schema through the manager it hands to the table, so the open-time read warms the cache the table keeps.FileSystemCatalog::GetTableopens a system table with the data table's root path;RestCatalog::GetTablereads the UUID, location and schema from one response (avoiding mixed generations after a table recreation) and opens the table with the per-table file system (LoadTableSchemagains atable_pathout-parameter);MockVersionManagedCatalogserves the per-table file system the same way.examples/read_write_demo.cppopens the table viacatalog->GetTableand creates all four operators throughtable->NewXxx(...).The moved operator bodies are unchanged (pure relocation): the operators still build their components from the context — wiring them to the table-held managers is a follow-up.
Tests
TableTestcases:TestCreateHoldsTheFileSystem(fs + root path retained),TestManagersBoundToTheTable(managers bound to the table's fs/path/branch; the kept schema manager serves the schemaTable::Createread, i.e. the warmed cache; a branch table keeps branch-bound managers),TestCurrentBranch(main default, identifier-named branch),TestCatalogOpenedTableServesThePerTableFileSystem(no fs handed out → no managers; per-table fs served when issued),TestCreateBuildsTheOperator(the fourXxx::Createbuild through a catalog-configured context).FileSystemCatalogTest.TestOptionsSystemTableCatalogandTestCreateTableWithBlobassert the root path a table carries (a system table gets the data table's path).cmake --build build --target paimon-core-test -j 96built clean;./build/release/paimon-core-test --gtest_filter='TableTest.*:FileSystemCatalogTest.*'passed 45/45; the full suitectest -j 96inbuild/(Release) passed 31/31 targets;git diff main HEAD --checkclean.RestCatalog::GetTableis not compiled locally: both local build directories havePAIMON_ENABLE_REST=OFF, so REST coverage relies on CI.API and Format
Yes, a breaking C++ API change in
include/paimon/catalog/table.h: the publicTableconstructor changes from(schema, identifier, uuid)to(file_system, root_path, schema, identifier, uuid = "", schema_manager = nullptr), so direct constructions must be updated (all in-tree ones are). New read-only accessors are added; the signatures and behavior of the fourXxx::Create(context)statics and ofTable::NewXxx(context)are unchanged. No storage format or protocol change.Documentation
No new user-facing option or feature; the resolved-handle semantics and the manager lifetimes are documented in the
Tableclass doc comments.Generative AI tooling
Generated-by: Qoder