[SPARK-52729][SQL][FOLLOWUP] Rename MetadataOnlyTable to MetadataTable and RelationCatalog to TableViewCatalog#55587
Closed
gengliangwang wants to merge 2 commits into
Conversation
…ewCatalog, loadRelation -> loadTableOrView
- MetadataTable drops the "Only" qualifier; reads naturally as the Table backed by a
TableInfo (and ViewInfo via subclass).
- TableViewCatalog explicitly names what the interface covers and avoids overloading
Spark's "Relation" terminology (BaseRelation, LogicalRelation, etc.).
- TableViewCatalog.loadTableOrView is the single-RPC perf entry point; the new name
matches the contract on the interface ("returns a Table or a view"). The unrelated
helpers CatalogV2Util.loadRelation and the private RelationResolution.loadRelation
(V2TableReference -> LogicalPlan) keep their names.
Test fixture TestingRelationCatalog -> TestingTableViewCatalog. Suites
DataSourceV2MetadataOnlyTableSuite/DataSourceV2MetadataOnlyViewSuite -> drop "Only"
to mirror the class.
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.
What changes were proposed in this pull request?
Renames for the v2 catalog API introduced in #51419 (SPARK-52729):
MetadataOnlyTable→MetadataTableRelationCatalog→TableViewCatalogRelationCatalog.loadRelation→TableViewCatalog.loadTableOrViewPlus mechanical follow-on renames:
Catalogs.validateRelationCatalog→validateTableViewCatalogTestingRelationCatalog(test fixture) →TestingTableViewCatalogDataSourceV2MetadataOnlyTableSuite→DataSourceV2MetadataTableSuiteDataSourceV2MetadataOnlyViewSuite→DataSourceV2MetadataViewSuiteOut of scope (intentionally untouched):
CatalogV2Util.loadRelation(catalog, ident)— pre-existingTable→NamedRelationhelper, unrelated to the renamed method.RelationResolution.loadRelation(V2TableReference)— unrelated private method on the analyzer.OptimizeMetadataOnlyQueryand friends — separate "metadata-only query" optimizer concept.Why are the changes needed?
MetadataOnlyTablereads more naturally asMetadataTable— the type is aTablebacked by aTableInfo(orViewInfo), mirroring the underlying DTO. The "Only" qualifier adds length without conveying additional meaning.RelationCatalogcollides with Spark's heavily-overloaded "Relation" terminology (BaseRelation,LogicalRelation,UnresolvedRelation— all data-source v1 concepts).TableViewCatalogis explicit about the kinds it covers and pairs symmetrically withTableCatalog/ViewCatalog.loadTableOrViewdescribes the method's contract directly ("returns aTablefor a table, or aMetadataTablewrapping aViewInfofor a view") instead of leaning on the overloaded "Relation" term.Does this PR introduce any user-facing change?
For connector developers: yes — the renamed types and method are part of the new DS v2 catalog API. The original names ship in 4.2.0 (unreleased at time of this PR), so the rename lands before any release exposes them. No SQL-level or runtime behavior change.
How was this patch tested?
Existing test suites renamed and re-run:
DataSourceV2MetadataTableSuite— 4 tests, all pass.DataSourceV2MetadataViewSuite— 56 tests, all pass.Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude (Anthropic)