aboutsummaryrefslogtreecommitdiff
path: root/sql/core/src/test/scala
diff options
context:
space:
mode:
authorgatorsmile <gatorsmile@gmail.com>2016-09-18 15:37:15 +0800
committerWenchen Fan <wenchen@databricks.com>2016-09-18 15:37:15 +0800
commit3a3c9ffbd282244407e9437c2b02ae7e062dd183 (patch)
treeb591e2ca7096f92e012ed1a3717f2ac13cf8a28b /sql/core/src/test/scala
parent8faa5217b44e8d52eab7eb2d53d0652abaaf43cd (diff)
downloadspark-3a3c9ffbd282244407e9437c2b02ae7e062dd183.tar.gz
spark-3a3c9ffbd282244407e9437c2b02ae7e062dd183.tar.bz2
spark-3a3c9ffbd282244407e9437c2b02ae7e062dd183.zip
[SPARK-17518][SQL] Block Users to Specify the Internal Data Source Provider Hive
### What changes were proposed in this pull request? In Spark 2.1, we introduced a new internal provider `hive` for telling Hive serde tables from data source tables. This PR is to block users to specify this in `DataFrameWriter` and SQL APIs. ### How was this patch tested? Added a test case Author: gatorsmile <gatorsmile@gmail.com> Closes #15073 from gatorsmile/formatHive.
Diffstat (limited to 'sql/core/src/test/scala')
-rw-r--r--sql/core/src/test/scala/org/apache/spark/sql/internal/CatalogSuite.scala7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/internal/CatalogSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/internal/CatalogSuite.scala
index b221eed7b2..549fd63f74 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/internal/CatalogSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/internal/CatalogSuite.scala
@@ -322,6 +322,13 @@ class CatalogSuite
assert(e2.message == "Cannot create a file-based external data source table without path")
}
+ test("createExternalTable should fail if provider is hive") {
+ val e = intercept[AnalysisException] {
+ spark.catalog.createExternalTable("tbl", "HiVe", Map.empty[String, String])
+ }
+ assert(e.message.contains("Cannot create hive serde table with createExternalTable API"))
+ }
+
// TODO: add tests for the rest of them
}