Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/17858#discussion_r115672012
--- Diff:
sql/hive/src/test/scala/org/apache/spark/sql/hive/InsertIntoHiveTableSuite.scala
---
@@ -494,4 +494,45 @@ class InsertIntoHiveTableSuite extends QueryTest with
TestHiveSingleton with Bef
spark.table("t").write.insertInto(tableName)
}
}
+
+ private def dropTables(tableNames: String*): Unit = {
+ tableNames.foreach { name =>
+ sql(s"DROP TABLE IF EXISTS $name")
+ }
+ }
+
+ test(
+ """SPARK-20594: The staging directory should be appended with
".hive-staging"
+ |to avoid being deleted if we set hive.exec.stagingdir under the
table directory
+ |without start with "."""".stripMargin) {
+
+ dropTables("test_table", "test_table1")
+
+ sql("CREATE TABLE test_table (key int, value string)")
+
+ // Add some data.
+ testData.write.mode(SaveMode.Append).insertInto("test_table")
--- End diff --
You can simplify the above two lines by `
spark.range(1).write.saveAsTable("test_table")`
---
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]