Skip to content

Conversation

@jerqi
Copy link
Contributor

@jerqi jerqi commented Jul 4, 2021

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.

@github-actions github-actions bot added the SQL label Jul 4, 2021
@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@HyukjinKwon
Copy link
Member

@jerqi can you create a new JIRA instead of reusing SPARK-18217? The fixed versions would be different at least.

@jerqi jerqi changed the title [SPARK-18217][SQL][FOLLOWUP] Disallow altering permanent views based on temporary views or UDFs [SPARK-36011][SQL] Disallow altering permanent views based on temporary views or UDFs Jul 5, 2021
@jerqi
Copy link
Contributor Author

jerqi commented Jul 5, 2021

@jerqi can you create a new JIRA instead of reusing SPARK-18217? The fixed versions would be different at least.

OK, It's done

Copy link
Contributor

@linhongliu-db linhongliu-db left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, cc @cloud-fan

withTable(table) {
(1 to 10).toDF("id").write.saveAsTable(table)
val view = "v1"
val tView = "v2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I feel it's clearer to just hardcode "t", "v1", "v2"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@cloud-fan
Copy link
Contributor

thanks, merging to master/3.2!

@cloud-fan cloud-fan closed this in e0c6b2e Jul 6, 2021
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 <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
(cherry picked from commit e0c6b2e)
Signed-off-by: Wenchen Fan <[email protected]>
@cloud-fan
Copy link
Contributor

@jerqi can you help to create backport PRs for 3.1 and 3.0? thanks!

@jerqi
Copy link
Contributor Author

jerqi commented Jul 6, 2021

@jerqi can you help to create backport PRs for 3.1 and 3.0? thanks!

Ok, it's my pleasure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants