diff options
author | gatorsmile <gatorsmile@gmail.com> | 2016-03-26 20:12:30 -0700 |
---|---|---|
committer | Yin Huai <yhuai@databricks.com> | 2016-03-26 20:12:30 -0700 |
commit | a01b6a92b5f0287a5236bddb1b817d13f320d489 (patch) | |
tree | a61865cc9473235e8f505c7184fbe555e3d90dd7 /sql/hive/src | |
parent | bc925b73a65ad57a636e6e6cb5648e4aed027af5 (diff) | |
download | spark-a01b6a92b5f0287a5236bddb1b817d13f320d489.tar.gz spark-a01b6a92b5f0287a5236bddb1b817d13f320d489.tar.bz2 spark-a01b6a92b5f0287a5236bddb1b817d13f320d489.zip |
[SPARK-14177][SQL] Native Parsing for DDL Command "Describe Database" and "Alter Database"
#### What changes were proposed in this pull request?
This PR is to provide native parsing support for two DDL commands: ```Describe Database``` and ```Alter Database Set Properties```
Based on the Hive DDL document:
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL
##### 1. ALTER DATABASE
**Syntax:**
```SQL
ALTER (DATABASE|SCHEMA) database_name SET DBPROPERTIES (property_name=property_value, ...)
```
- `ALTER DATABASE` is to add new (key, value) pairs into `DBPROPERTIES`
##### 2. DESCRIBE DATABASE
**Syntax:**
```SQL
DESCRIBE DATABASE [EXTENDED] db_name
```
- `DESCRIBE DATABASE` shows the name of the database, its comment (if one has been set), and its root location on the filesystem. When `extended` is true, it also shows the database's properties
#### How was this patch tested?
Added the related test cases to `DDLCommandSuite`
Author: gatorsmile <gatorsmile@gmail.com>
Author: xiaoli <lixiao1983@gmail.com>
Author: Xiao Li <xiaoli@Xiaos-MacBook-Pro.local>
This patch had conflicts when merged, resolved by
Committer: Yin Huai <yhuai@databricks.com>
Closes #11977 from gatorsmile/parseAlterDatabase.
Diffstat (limited to 'sql/hive/src')
-rw-r--r-- | sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala index 61fe0985c1..e5bcb9b1db 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala @@ -85,7 +85,6 @@ private[hive] class HiveQl(conf: ParserConf) extends SparkQl(conf) with Logging protected val nativeCommands = Seq( "TOK_ALTERDATABASE_OWNER", - "TOK_ALTERDATABASE_PROPERTIES", "TOK_ALTERINDEX_PROPERTIES", "TOK_ALTERINDEX_REBUILD", "TOK_ALTERTABLE_ALTERPARTS", @@ -100,8 +99,6 @@ private[hive] class HiveQl(conf: ParserConf) extends SparkQl(conf) with Logging "TOK_CREATEMACRO", "TOK_CREATEROLE", - "TOK_DESCDATABASE", - "TOK_DROPINDEX", "TOK_DROPMACRO", "TOK_DROPROLE", |