GitHub user cloud-fan opened a pull request: https://github.com/apache/spark/pull/15099
[SPARK-17541][SQL] fix some DDL bugs about table management when same-name temp view exists ## What changes were proposed in this pull request? In `SessionCatalog`, we have several operations(`tableExists`, `dropTable`, `loopupRelation`, etc) that handle both temp views and metastore tables/views. This brings some bugs to DDL commands that want to handle temp view only or metastore table/view only. These bugs are: 1. `CREATE TABLE USING` will fail if a same-name temp view exists 2. `Catalog.dropTempView`will un-cache and drop metastore table if a same-name table exists 3. `saveAsTable` will fail or have unexpected behaviour if a same-name temp view exists. These bug fixes are pulled out from https://github.com/apache/spark/pull/14962 and targets both master and 2.0 branch ## How was this patch tested? new regression tests You can merge this pull request into a Git repository by running: $ git pull https://github.com/cloud-fan/spark fix-view Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/15099.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 #15099 ---- commit 7fcee4501114793d508f0f6add1915572b48b587 Author: Wenchen Fan <wenc...@databricks.com> Date: 2016-09-14T16:50:22Z fix some DDL bugs about table management when same-name temp view exists ---- --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org