[SPARK-52417][SQL] Simplify Table properties handling in View Schema Evolution Mode #51107
+10
−17
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?
When a View is created, ex CREATE VIEW v (a1 INT, a2 STRING) AS select c1, c2, it needs to save both set of columns (alias and query output).
In the new Schema Evolution mode, we never allow alias, so view schema == view query output schema. Every time we detect the output view schema changes, we sync the view's schema with view query schema, keeping the invariant.
So we can simplify the update in Schema Evolution mode to not update the Table Properties, and instead rely on the View Schema all the time.
Why are the changes needed?
View Schema Evolution is a useful mode. However, it requires a lot of permissions on the user querying the view, because that user needs to update the View definition. It will simplify auth if we do not have to update the properties too (which could be admin-level properties), and reduce the update to only the schema.
Does this PR introduce any user-facing change?
No
How was this patch tested?
Existing unit test
Was this patch authored or co-authored using generative AI tooling?
No