[SPARK-58895][SQL] Route custom session view catalogs through V2 commands - #58161
Open
manuzhang wants to merge 2 commits into
Open
[SPARK-58895][SQL] Route custom session view catalogs through V2 commands#58161manuzhang wants to merge 2 commits into
manuzhang wants to merge 2 commits into
Conversation
…ands Generated-by: Codex (GPT-5)
Co-authored-by: Codex <codex@openai.com>
manuzhang
marked this pull request as ready for review
August 20, 2026 08:38
Member
Author
|
@szehon-ho @aokolnychyi This is another gap discovered while working on apache/iceberg#14984. Please help review, thanks! |
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?
This PR routes view commands through V2 execution when a custom
ViewCatalogis installed asspark_catalog.The change:
ResolveSessionCataloguse V1 view commands only for session catalogs that do notimplement
ViewCatalog, while preserving V1 handling for delegatedV1Viewinstances;removal through the existing V2 commands;
SHOW VIEWSto combine native V2 views with delegated V1 views and local/globaltemporary views, including filtering, de-duplication, multi-part namespaces, and namespace
error handling; and
ViewCatalog.Why are the changes needed?
Spark currently identifies
spark_catalogas the session catalog and rewrites its view commandsto V1 commands even when the configured implementation supports
ViewCatalog. This bypasses thecustom catalog's view implementation and makes commands such as
CREATE VIEW,ALTER VIEW,DROP VIEW, andSHOW VIEWSbehave inconsistently.The dispatch needs to consider the catalog's view capability and the resolved view payload so
native V2 views use the custom catalog while delegated V1 and temporary views retain their
existing behavior.
Does this PR introduce any user-facing change?
Yes. When
spark_catalogis configured with a customViewCatalog, persistent view DDL andinspection commands now operate through that catalog. Delegated V1 views and temporary views
remain accessible, including through
SHOW VIEWS. Session catalogs withoutViewCatalogkeeptheir existing V1 behavior.
How was this patch tested?
Added tests to
DataSourceV2MetadataViewSuitecovering:ViewCatalogis installed asspark_catalog;SHOW VIEWSfiltering, custom-only and multi-part namespaces, and persistent/global-temp namecollisions; and
No tests were run locally, per the repository instructions for this session.
git diff --checkpasses.
Was this patch authored or co-authored using generative AI tooling?
Generated-by: Codex (GPT-5)