You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by cloud-fan <gi...@git.apache.org> on 2016/11/02 06:35:17 UTC
[GitHub] spark pull request #15011: [SPARK-17122][SQL]support drop current database
Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/15011#discussion_r86080198
--- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalogSuite.scala ---
@@ -127,6 +127,18 @@ class SessionCatalogSuite extends SparkFunSuite {
catalog.dropDatabase("db_that_does_not_exist", ignoreIfNotExists = true, cascade = false)
}
+ test("drop current database and drop default database") {
+ val catalog = new SessionCatalog(newBasicCatalog())
+ catalog.setCurrentDatabase("db1")
+ assert(catalog.getCurrentDatabase == "db1")
+ catalog.dropDatabase("db1", ignoreIfNotExists = false, cascade = true)
--- End diff --
can we add a test case to make sure that, if the current database is dropped, other DDL command should fail, e.g. CREATE TABLE should complain database xxx doesn't exist
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org