Github user yhuai commented on a diff in the pull request:
https://github.com/apache/spark/pull/13766#discussion_r67610318
--- Diff:
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala
---
@@ -1684,36 +1684,4 @@ class SQLQuerySuite extends QueryTest with
SQLTestUtils with TestHiveSingleton {
)
}
}
-
- test("SPARK-16036: better error message when insert into a table with
mismatch schema") {
- withTable("hive_table", "datasource_table") {
- sql("CREATE TABLE hive_table(a INT) PARTITIONED BY (b INT, c INT)")
- sql("CREATE TABLE datasource_table(a INT, b INT, c INT) USING
parquet PARTITIONED BY (b, c)")
- val e1 = intercept[AnalysisException] {
- sql("INSERT INTO TABLE hive_table PARTITION(b=1, c=2) SELECT 1, 2,
3")
- }
- assert(e1.message.contains("the number of columns are different"))
- val e2 = intercept[AnalysisException] {
- sql("INSERT INTO TABLE datasource_table PARTITION(b=1, c=2) SELECT
1, 2, 3")
- }
- assert(e2.message.contains("the number of columns are different"))
- }
- }
-
- test("SPARK-16037: INSERT statement should match columns by position") {
- withTable("hive_table", "datasource_table") {
- sql("CREATE TABLE hive_table(a INT) PARTITIONED BY (b INT, c INT)")
- sql("CREATE TABLE datasource_table(a INT, b INT, c INT) USING
parquet PARTITIONED BY (b, c)")
-
- withSQLConf("hive.exec.dynamic.partition.mode" -> "nonstrict") {
- sql("INSERT INTO TABLE hive_table SELECT 1, 2 AS c, 3 AS b")
- checkAnswer(sql("SELECT a, b, c FROM hive_table"), Row(1, 2, 3))
- sql("INSERT OVERWRITE TABLE hive_table SELECT 1, 2, 3")
- checkAnswer(sql("SELECT a, b, c FROM hive_table"), Row(1, 2, 3))
- }
-
- sql("INSERT INTO TABLE datasource_table SELECT 1, 2 AS c, 3 AS b")
- checkAnswer(sql("SELECT a, b, c FROM datasource_table"), Row(1, 2,
3))
- }
- }
--- End diff --
Moved to
https://github.com/apache/spark/pull/13766/files#diff-b5aae69ebe04e0a1b9c6788638f468d1R375
---
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]