dongjoon-hyun commented on a change in pull request #23905: [SPARK-24669][SQL]
Refresh table before drop database cascade
URL: https://github.com/apache/spark/pull/23905#discussion_r262712905
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala
##########
@@ -2715,4 +2715,37 @@ abstract class DDLSuite extends QueryTest with
SQLTestUtils {
}
assert(ex.getMessage.contains("Spark config"))
}
+
+ test("Refresh table before drop database cascade") {
+ withTempDir { tempDir =>
+ val file1 = new File(tempDir + "/first.csv")
+ val writer1 = new PrintWriter(file1)
+ writer1.write("first")
+ writer1.close()
+
+ val file2 = new File(tempDir + "/second.csv")
+ val writer2 = new PrintWriter(file2)
+ writer2.write("second")
+ writer2.close()
+
+ withDatabase("foo") {
+ sql("CREATE DATABASE foo")
+ sql(
+ s"""CREATE TABLE foo.first (id string)
+ |USING csv options (path='${file1.toURI}')
+ """.stripMargin)
+ sql("SELECT * FROM foo.first")
+ checkAnswer(spark.table("foo.first"), Row("first"))
Review comment:
Add a new line after this.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]