-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-29678][SQL] ALTER TABLE (ADD PARTITION) should look up catalog/table like v2 commands #26369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| | ALTER TABLE tableIdentifier (partitionSpec)? | ||
| SET SERDEPROPERTIES tablePropertyList #setTableSerDe | ||
| | ALTER TABLE tableIdentifier ADD (IF NOT EXISTS)? | ||
| | ALTER (TABLE | VIEW) multipartIdentifier ADD (IF NOT EXISTS)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am combining these two since ALTER VIEW is not supported for ADD PARTITION and this rule is compatible with the view rule.
| spec -> location | ||
| } | ||
| } else { | ||
| // Alter View: the location clauses are not allowed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also removed this check in ASTBuilder.scala since view check is already done at the top.
|
Test build #113132 has finished for PR 26369 at commit
|
|
retest this please |
|
Test build #113138 has finished for PR 26369 at commit
|
|
retest this please |
|
Test build #113155 has finished for PR 26369 at commit
|
|
retest this please |
|
Test build #113174 has finished for PR 26369 at commit
|
|
cc: @cloud-fan @viirya |
|
thanks, merging to master! |
|
lgtm |
What changes were proposed in this pull request?
Add AlterTableAddPartitionStatement and make ALTER TABLE ... ADD PARTITION go through the same catalog/table resolution framework of v2 commands.
Why are the changes needed?
It's important to make all the commands have the same table resolution behavior, to avoid confusing end-users. e.g.
Does this PR introduce any user-facing change?
Yes. When running ALTER TABLE ... ADD PARTITION, Spark fails the command if the current catalog is set to a v2 catalog, or the table name specified a v2 catalog.
How was this patch tested?
Unit tests