[SPARK-36011][SQL] Disallow altering permanent views based on temporary views or UDFs#33204
Closed
roryqi wants to merge 4 commits intoapache:masterfrom
Closed
[SPARK-36011][SQL] Disallow altering permanent views based on temporary views or UDFs#33204roryqi wants to merge 4 commits intoapache:masterfrom
roryqi wants to merge 4 commits intoapache:masterfrom
Conversation
|
Can one of the admins verify this patch? |
Member
|
@jerqi can you create a new JIRA instead of reusing SPARK-18217? The fixed versions would be different at least. |
Contributor
Author
OK, It's done |
sql/core/src/test/scala/org/apache/spark/sql/execution/SQLViewSuite.scala
Outdated
Show resolved
Hide resolved
sql/core/src/main/scala/org/apache/spark/sql/execution/command/views.scala
Outdated
Show resolved
Hide resolved
Contributor
linhongliu-db
left a comment
There was a problem hiding this comment.
lgtm, cc @cloud-fan
cloud-fan
reviewed
Jul 6, 2021
| withTable(table) { | ||
| (1 to 10).toDF("id").write.saveAsTable(table) | ||
| val view = "v1" | ||
| val tView = "v2" |
Contributor
There was a problem hiding this comment.
nit: I feel it's clearer to just hardcode "t", "v1", "v2"
cloud-fan
approved these changes
Jul 6, 2021
sql/core/src/main/scala/org/apache/spark/sql/execution/command/views.scala
Show resolved
Hide resolved
added 2 commits
July 6, 2021 11:26
Contributor
|
thanks, merging to master/3.2! |
cloud-fan
pushed a commit
that referenced
this pull request
Jul 6, 2021
…ry views or UDFs ### What changes were proposed in this pull request? PR #15764 disabled creating permanent views based on temporary views or UDFs. But AlterViewCommand didn't block temporary objects. ### Why are the changes needed? More robust view canonicalization. ### Does this PR introduce _any_ user-facing change? Yes, now if you alter a permanent view based on temporary views or UDFs, the operation will fail. ### How was this patch tested? Add new unit tests. Closes #33204 from jerqi/alter_view. Authored-by: RoryQi <1242949407@qq.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com> (cherry picked from commit e0c6b2e) Signed-off-by: Wenchen Fan <wenchen@databricks.com>
Contributor
|
@jerqi can you help to create backport PRs for 3.1 and 3.0? thanks! |
Contributor
Author
Ok, it's my pleasure. |
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?
PR #15764 disabled creating permanent views based on temporary views or UDFs. But AlterViewCommand didn't block temporary objects.
Why are the changes needed?
More robust view canonicalization.
Does this PR introduce any user-facing change?
Yes, now if you alter a permanent view based on temporary views or UDFs, the operation will fail.
How was this patch tested?
Add new unit tests.