-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-48720][SQL] Align the command ALTER TABLE ... UNSET TBLPROPERTIES ... in v1 and v2
#47097
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d5d1f9b
[SPARK-48720][SQL] Fix `IF EXISTS` ignored for `ALTER TABLE ... UNSET…
panbingkun 88e4a30
Merge branch 'master' into alter_unset_table
panbingkun 31cbde1
Merge branch 'master' into alter_unset_table
panbingkun 1d3b582
Merge branch 'master' into alter_unset_table
panbingkun 0de8ddf
update
panbingkun 5733fbb
update
panbingkun 4d5df8b
Merge branch 'master' into alter_unset_table
panbingkun 9a8dcf3
remove ifExists logical
panbingkun fe674fe
fix
panbingkun 1c0c260
update docs/sql-ref-syntax-ddl-alter-table.md
panbingkun a964a0f
Merge branch 'master' into alter_unset_table
panbingkun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
update
- Loading branch information
commit 5733fbbfc225b4795a0220cf23d6bc9d5fe79fe1
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -236,20 +236,30 @@ ALTER TABLE table_identifier DROP [ IF EXISTS ] partition_spec [PURGE] | |
|
|
||
| ### SET AND UNSET | ||
|
|
||
| #### SET TABLE PROPERTIES | ||
| #### SET PROPERTIES | ||
|
|
||
| `ALTER TABLE SET` command is used for setting the table properties. If a particular property was already set, | ||
| this overrides the old value with the new one. | ||
|
|
||
| `ALTER TABLE UNSET` is used to drop the table property. | ||
|
|
||
| ##### Syntax | ||
|
|
||
| ```sql | ||
| -- Set Table Properties | ||
| -- Set Properties | ||
| ALTER TABLE table_identifier SET TBLPROPERTIES ( key1 = val1, key2 = val2, ... ) | ||
| ``` | ||
|
|
||
| #### UNSET PROPERTIES | ||
|
|
||
| `ALTER TABLE UNSET` command is used to drop the table property. | ||
|
|
||
| -- Unset Table Properties | ||
| **Note:** If the specified property key does not exist, when you use the v1 command and do not specify `IF EXISTS`, | ||
| it will throw the error-condition `UNSET_NONEXISTENT_PROPERTIES` and finally `failed`, | ||
| however regardless of whether `IF EXISTS` is set or not, the v2 command will ignore it and finally `succeed`. | ||
|
|
||
| ##### Syntax | ||
|
|
||
| ```sql | ||
| -- Unset Properties | ||
| ALTER TABLE table_identifier UNSET TBLPROPERTIES [ IF EXISTS ] ( key1, key2, ... ) | ||
|
||
| ``` | ||
|
|
||
|
|
||
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
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
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.
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.
shall we change the v1 behavior as well? It's not a breaking change to change from failure to no failure.
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.
and we should avoid mentioning v1/v2 in the doc. It's an internal concept and should not be exposed to end users
Uh oh!
There was an error while loading. Please reload this page.
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.
Sure, let me update it.
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.
Okay.
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.
Done.