GitHub user gatorsmile opened a pull request:

    https://github.com/apache/spark/pull/12009

    [SPARK-14124] [SQL] Implement Database-related DDL Commands

    #### What changes were proposed in this pull request?
    This PR is to implement the following four Database-related DDL commands:
     - `CREATE DATABASE|SCHEMA [IF NOT EXISTS] database_name`
     - `DROP DATABASE [IF EXISTS] database_name [RESTRICT|CASCADE]`
     - `DESCRIBE DATABASE [EXTENDED] db_name`
     - `ALTER (DATABASE|SCHEMA) database_name SET DBPROPERTIES 
(property_name=property_value, ...)`
    
    Another PR will be submitted to handle the unsupported commands. In the 
Database-related DDL commands, we will issue an error exception for `ALTER 
(DATABASE|SCHEMA) database_name SET OWNER [USER|ROLE] user_or_role`.
    
    cc @yhuai @andrewor14 @rxin Could you review the changes? Is it in the 
right direction? Thanks!
    
    #### How was this patch tested?
    Added a few test cases in `command/DDLSuite.scala` for testing DDL command 
execution in `SQLContext`. Since `HiveContext` also shares the same 
implementation, the existing test cases in `\hive` also verifies the 
correctness of these commands.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/gatorsmile/spark dbDDL

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/12009.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #12009
    
----
commit 602cace43c7b2c2ae3c59b6b742a58cf986d03f8
Author: gatorsmile <[email protected]>
Date:   2016-03-25T17:14:31Z

    native DDL support for create database

commit e26542e248796c4db1dc830b4c0febe48b7284f3
Author: gatorsmile <[email protected]>
Date:   2016-03-27T15:34:08Z

    Merge remote-tracking branch 'upstream/master' into dbDDL

commit 2794bfa2f3675c5703f98540f3663a4cfe3c9126
Author: gatorsmile <[email protected]>
Date:   2016-03-27T18:28:58Z

    set the directory for database creation

commit 65ce660dc68576e43c6c96ba8481643787bafde3
Author: gatorsmile <[email protected]>
Date:   2016-03-28T02:02:34Z

    add a default db extension.

commit aba3a959a5f308958a9924873057ca25222d322e
Author: gatorsmile <[email protected]>
Date:   2016-03-28T16:52:12Z

    native support for drop/alter/describe database

commit ffe0c7aca597c749c6ae755500a440b5466180da
Author: gatorsmile <[email protected]>
Date:   2016-03-28T18:09:24Z

    add more test cases.

commit d7c36488746fb9c414aaf2f28aceeefcd078ba95
Author: gatorsmile <[email protected]>
Date:   2016-03-28T18:15:26Z

    added an extra line.

commit 9420f08408810ee3bce027d1dcbdefa848ae8d13
Author: gatorsmile <[email protected]>
Date:   2016-03-28T19:25:16Z

    added more comments.

commit 4dab82c833e84d0426b550b88945e8821933715f
Author: gatorsmile <[email protected]>
Date:   2016-03-28T19:30:09Z

    update the comment.

commit f4c33e236334057be545d25c3147e4ecbb412a99
Author: gatorsmile <[email protected]>
Date:   2016-03-28T19:36:26Z

    update the comment.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to