gengliangwang opened a new pull request, #55587:
URL: https://github.com/apache/spark/pull/55587
### What changes were proposed in this pull request?
Renames for the v2 catalog API introduced in #51419 (SPARK-52729):
- `MetadataOnlyTable` → `MetadataTable`
- `RelationCatalog` → `TableViewCatalog`
- `RelationCatalog.loadRelation` → `TableViewCatalog.loadTableOrView`
Plus mechanical follow-on renames:
- `Catalogs.validateRelationCatalog` → `validateTableViewCatalog`
- `TestingRelationCatalog` (test fixture) → `TestingTableViewCatalog`
- `DataSourceV2MetadataOnlyTableSuite` → `DataSourceV2MetadataTableSuite`
- `DataSourceV2MetadataOnlyViewSuite` → `DataSourceV2MetadataViewSuite`
Out of scope (intentionally untouched):
- `CatalogV2Util.loadRelation(catalog, ident)` — pre-existing `Table` →
`NamedRelation` helper, unrelated to the renamed method.
- `RelationResolution.loadRelation(V2TableReference)` — unrelated private
method on the analyzer.
- `OptimizeMetadataOnlyQuery` and friends — separate "metadata-only query"
optimizer concept.
### Why are the changes needed?
- `MetadataOnlyTable` reads more naturally as `MetadataTable` — the type is
a `Table` backed by a `TableInfo` (or `ViewInfo`), mirroring the underlying
DTO. The "Only" qualifier adds length without conveying additional meaning.
- `RelationCatalog` collides with Spark's heavily-overloaded "Relation"
terminology (`BaseRelation`, `LogicalRelation`, `UnresolvedRelation` — all
data-source v1 concepts). `TableViewCatalog` is explicit about the kinds it
covers and pairs symmetrically with `TableCatalog` / `ViewCatalog`.
- `loadTableOrView` describes the method's contract directly ("returns a
`Table` for a table, or a `MetadataTable` wrapping a `ViewInfo` for 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)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]