-
- Downloads
[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.
Showing
- sql/core/src/main/scala/org/apache/spark/sql/execution/SparkQl.scala 27 additions, 0 deletions...c/main/scala/org/apache/spark/sql/execution/SparkQl.scala
- sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala 15 additions, 0 deletions...in/scala/org/apache/spark/sql/execution/command/ddl.scala
- sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLCommandSuite.scala 38 additions, 0 deletions.../apache/spark/sql/execution/command/DDLCommandSuite.scala
- sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala 0 additions, 3 deletions...ive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala
Loading
Please register or sign in to comment