Skip to content
Snippets Groups Projects
Commit 4e7a29ef authored by Dongjoon Hyun's avatar Dongjoon Hyun Committed by gatorsmile
Browse files

[SPARK-21913][SQL][TEST] withDatabase` should drop database with CASCADE

## What changes were proposed in this pull request?

Currently, `withDatabase` fails if the database is not empty. It would be great if we drop cleanly with CASCADE.

## How was this patch tested?

This is a change on test util. Pass the existing Jenkins.

Author: Dongjoon Hyun <dongjoon@apache.org>

Closes #19125 from dongjoon-hyun/SPARK-21913.
parent ca59445a
No related branches found
No related tags found
No related merge requests found
......@@ -247,7 +247,7 @@ private[sql] trait SQLTestUtils
protected def withDatabase(dbNames: String*)(f: => Unit): Unit = {
try f finally {
dbNames.foreach { name =>
spark.sql(s"DROP DATABASE IF EXISTS $name")
spark.sql(s"DROP DATABASE IF EXISTS $name CASCADE")
}
spark.sql(s"USE $DEFAULT_DATABASE")
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment