Github user zuotingbing commented on a diff in the pull request:
https://github.com/apache/spark/pull/17858#discussion_r115893632
--- Diff:
sql/hive/src/test/scala/org/apache/spark/sql/hive/InsertIntoHiveTableSuite.scala
---
@@ -494,4 +494,34 @@ class InsertIntoHiveTableSuite extends QueryTest with
TestHiveSingleton with Bef
spark.table("t").write.insertInto(tableName)
}
}
+
+ test(
+ """SPARK-20594: This is a walk-around fix to resolve a Hive bug. Hive
requires that the
+ |staging directory needs to avoid being deleted when users set
hive.exec.stagingdir
+ |under the table directory.""".stripMargin) {
+
+ withTable("test_table", "test_table1") {
+ spark.range(1).write.saveAsTable("test_table")
+
+ // Make sure the table has also been updated.
+ checkAnswer(
+ sql("SELECT * FROM test_table"),
+ Row(0)
+ )
+
+ sql("CREATE TABLE test_table1 (key int)")
+
+ // Set hive.exec.stagingdir under the table directory without start
with ".".
+ sql("set hive.exec.stagingdir=./test")
--- End diff --
Hmm, you means i should add `sql("reset")` after this test case,right?
---
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]