diff options
author | gatorsmile <gatorsmile@gmail.com> | 2016-04-14 08:34:11 -0700 |
---|---|---|
committer | Yin Huai <yhuai@databricks.com> | 2016-04-14 08:34:11 -0700 |
commit | 0d22092cd9c8876a7f226add578ff1c025012fe9 (patch) | |
tree | 5ae02c9621897418c34ca5c63f13662cc0c21b58 /core/src/main/scala | |
parent | f83ba454a507bec0cc389d9a382cd71add7f17c1 (diff) | |
download | spark-0d22092cd9c8876a7f226add578ff1c025012fe9.tar.gz spark-0d22092cd9c8876a7f226add578ff1c025012fe9.tar.bz2 spark-0d22092cd9c8876a7f226add578ff1c025012fe9.zip |
[SPARK-14125][SQL] Native DDL Support: Alter View
#### What changes were proposed in this pull request?
This PR is to provide a native DDL support for the following three Alter View commands:
Based on the Hive DDL document:
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL
##### 1. ALTER VIEW RENAME
**Syntax:**
```SQL
ALTER VIEW view_name RENAME TO new_view_name
```
- to change the name of a view to a different name
- not allowed to rename a view's name by ALTER TABLE
##### 2. ALTER VIEW SET TBLPROPERTIES
**Syntax:**
```SQL
ALTER VIEW view_name SET TBLPROPERTIES ('comment' = new_comment);
```
- to add metadata to a view
- not allowed to set views' properties by ALTER TABLE
- ignore it if trying to set a view's existing property key when the value is the same
- overwrite the value if trying to set a view's existing key to a different value
##### 3. ALTER VIEW UNSET TBLPROPERTIES
**Syntax:**
```SQL
ALTER VIEW view_name UNSET TBLPROPERTIES [IF EXISTS] ('comment', 'key')
```
- to remove metadata from a view
- not allowed to unset views' properties by ALTER TABLE
- issue an exception if trying to unset a view's non-existent key
#### How was this patch tested?
Added test cases to verify if it works properly.
Author: gatorsmile <gatorsmile@gmail.com>
Author: xiaoli <lixiao1983@gmail.com>
Author: Xiao Li <xiaoli@Xiaos-MacBook-Pro.local>
Closes #12324 from gatorsmile/alterView.
Diffstat (limited to 'core/src/main/scala')
0 files changed, 0 insertions, 0 deletions