Core: Support CachingCatalog commit tracking for specialized tables - #17401
Draft
ysung wants to merge 2 commits into
Draft
Core: Support CachingCatalog commit tracking for specialized tables#17401ysung wants to merge 2 commits into
ysung wants to merge 2 commits into
Conversation
Generated-by: Codex Co-authored-by: Humzah Kiani <humzah.kiani@affirm.com> Co-authored-by: Codex (GPT-5) <noreply@openai.com>
Generated-by: Codex Co-authored-by: Humzah Kiani <humzah.kiani@affirm.com> Co-authored-by: Codex (GPT-5) <noreply@openai.com>
ysung
force-pushed
the
agent/caching-catalog-specialized-table-commits
branch
from
July 29, 2026 01:30
3a0bf8d to
2591c20
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.
Stacked PR
This is a draft follow-up to #17388. Until #17388 merges, GitHub shows both commits in this PR; the incremental diff is the specialized-table and REST support described below.
Summary
Tableimplementations opt in toCachingCatalogcommit tracking without mutating delegate-owned instancesRESTTablein while preserving REST state and server-side scan planningChange size relative to #17388
+207/-23, net+184) across 3 files+311/-0) across 2 filesDesign
#17388 installs commit-tracking operations on exact
BaseTableinstances. Specialized subclasses cannot be reconstructed asBaseTablewithout losing subtype behavior.This follow-up adds
SupportsOperationsReplacement. An implementation receives replacement operations and returns an independent copy of the same concrete class. Before caching that copy,CachingCatalogverifies that:RESTTableimplements the contract by copying all REST-specific state along with the replacement operations. The REST regression test verifies that a commit overlapping a reload observes the committed snapshot and thatplanFiles()still uses server-side planning.Implementations that do not opt in retain the same caching behavior as
main, without commit tracking. This avoids turning downstream custom table types into permanent cache misses.An opt-in implementation that returns null, the original instance, a different type, the wrong operations, mutates the original, or throws remains usable but that load is not cached. Each validation condition has direct regression coverage. The SPI also states that
withOperationsruns during cache computation and must not call back into the catalog or perform table operations.Open API question for maintainers
The current draft uses a public
SupportsOperationsReplacementinterface, following the existingSupportsDistributedScanPlanningpattern. Despite its internal-use documentation, this still permanently adds a public Java type.An alternative is a protected
BaseTablecopy-with-operations hook. The implementation and tests do not otherwise depend on which API shape maintainers prefer. Feedback on this choice is requested before this PR is marked ready for review.Runtime behavior and tradeoffs
RESTTableretains server-side scan planningoperations()returns the commit-tracking wrapper rather than the delegate operations' concrete runtime classValidation
./gradlew :iceberg-core:test --tests org.apache.iceberg.hadoop.TestCachingCatalog --tests org.apache.iceberg.rest.TestRESTScanPlanning.testCachingCatalogObservesCommitAfterConcurrentReloadWithServerSidePlanning./gradlew :iceberg-core:spotlessApply./gradlew :iceberg-core:revapiplanFiles()execution after wrapping and commit reconciliationPart of #17338
AI Disclosure