diff options
author | Wenchen Fan <wenchen@databricks.com> | 2016-12-28 21:50:21 -0800 |
---|---|---|
committer | Yin Huai <yhuai@databricks.com> | 2016-12-28 21:50:21 -0800 |
commit | 7d19b6ab7d75b95d9eb1c7e1f228d23fd482306e (patch) | |
tree | 703a3f2c311321ad2fd20e0d5780c553f8d08744 /sql/hive/src/test | |
parent | 93f35569fd4e7dc1e4037d3df538a21c526f9c5d (diff) | |
download | spark-7d19b6ab7d75b95d9eb1c7e1f228d23fd482306e.tar.gz spark-7d19b6ab7d75b95d9eb1c7e1f228d23fd482306e.tar.bz2 spark-7d19b6ab7d75b95d9eb1c7e1f228d23fd482306e.zip |
[SPARK-18567][SQL] Simplify CreateDataSourceTableAsSelectCommand
## What changes were proposed in this pull request?
The `CreateDataSourceTableAsSelectCommand` is quite complex now, as it has a lot of work to do if the table already exists:
1. throw exception if we don't want to ignore it.
2. do some check and adjust the schema if we want to append data.
3. drop the table and create it again if we want to overwrite.
The work 2 and 3 should be done by analyzer, so that we can also apply it to hive tables.
## How was this patch tested?
existing tests.
Author: Wenchen Fan <wenchen@databricks.com>
Closes #15996 from cloud-fan/append.
Diffstat (limited to 'sql/hive/src/test')
-rw-r--r-- | sql/hive/src/test/scala/org/apache/spark/sql/hive/MetastoreDataSourcesSuite.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/MetastoreDataSourcesSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/MetastoreDataSourcesSuite.scala index deb40f0464..0f787be0bb 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/MetastoreDataSourcesSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/MetastoreDataSourcesSuite.scala @@ -1239,7 +1239,7 @@ class MetastoreDataSourcesSuite extends QueryTest with SQLTestUtils with TestHiv var e = intercept[AnalysisException] { table(tableName).write.mode(SaveMode.Overwrite).saveAsTable(tableName) }.getMessage - assert(e.contains(s"Cannot overwrite table `$tableName` that is also being read from")) + assert(e.contains(s"Cannot overwrite table default.$tableName that is also being read from")) e = intercept[AnalysisException] { table(tableName).write.mode(SaveMode.ErrorIfExists).saveAsTable(tableName) |