[SPARK-58936][SQL] Add partial view updates to ViewCatalog - #58208
Open
manuzhang wants to merge 1 commit into
Open
[SPARK-58936][SQL] Add partial view updates to ViewCatalog#58208manuzhang wants to merge 1 commit into
manuzhang wants to merge 1 commit into
Conversation
Co-authored-by: Codex <codex@openai.com>
manuzhang
force-pushed
the
codex/add-view-changes
branch
from
August 21, 2026 16:05
4add20e to
7eb5bc2
Compare
manuzhang
marked this pull request as ready for review
August 24, 2026 13:57
Member
Author
|
@szehon-ho @aokolnychyi @cloud-fan This is the feature gap we found when implementing Iceberg integration with Spark 4.2 |
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 adds a partial-update API for catalog views:
ViewChangewith orderedSetPropertyandRemovePropertychanges.ViewCatalog.alterView(Identifier, ViewChange...).replaceView.ALTER VIEW ... SET TBLPROPERTIESandALTER VIEW ... UNSET TBLPROPERTIESthrough onealterViewchange batch.ALTER VIEW ... ASand schema-binding changes onreplaceView.Catalogs can override
alterViewto translate the full ordered batch into a native atomic update.Why are the changes needed?
The current V2 property ALTER executors rebuild a complete
Viewfrom metadata captured during analysis and callreplaceView. That prevents connectors from applying native property validation and atomic partial updates, and a full replacement can overwrite unrelated metadata changed concurrently.A
ViewChangeAPI, analogous toTableChange, gives connectors the requested operation instead of a reconstructed full view. The default implementation preserves compatibility for existingViewCatalogimplementations.Does this PR introduce any user-facing change?
Yes. This adds an evolving connector API for partial view updates. Existing catalogs remain compatible through the default implementation, and SQL SET/UNSET behavior is unchanged. Catalogs that override
alterViewcan provide native validation and atomic update semantics.How was this patch tested?
build/sbt catalyst/Test/compilebuild/sbt sql/Test/compilebuild/sbt 'catalyst/testOnly org.apache.spark.sql.connector.catalog.ViewCatalogSuite'SPARK_LOCAL_IP=127.0.0.1 SPARK_LOCAL_HOSTNAME=localhost build/sbt 'sql/testOnly org.apache.spark.sql.execution.command.v2.AlterViewSetTblPropertiesSuite org.apache.spark.sql.execution.command.v2.AlterViewUnsetTblPropertiesSuite'build/sbt catalyst/checkstyle catalyst/scalastyle catalyst/Test/scalastyle sql/scalastyle sql/Test/scalastyleWas this patch authored or co-authored using generative AI tooling?
Generated-by: Codex (GPT-5)