Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class ResolveSessionCatalog(val catalogManager: CatalogManager)
val newProperties = c.properties -- CatalogV2Util.NAMESPACE_RESERVED_PROPERTIES
CreateDatabaseCommand(name, c.ifNotExists, location, comment, newProperties)

case d @ DropNamespace(DatabaseInSessionCatalog(db), _, _) =>
case d @ DropNamespace(DatabaseInSessionCatalog(db), _, _) if conf.useV1Command =>
DropDatabaseCommand(db, d.ifExists, d.cascade)

case ShowTables(DatabaseInSessionCatalog(db), pattern, output) if conf.useV1Command =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ import org.apache.spark.sql.execution.command
* - V1 In-Memory catalog: `org.apache.spark.sql.execution.command.v1.DropNamespaceSuite`
* - V1 Hive External catalog: `org.apache.spark.sql.hive.execution.command.DropNamespaceSuite`
*/
trait DropNamespaceSuiteBase extends command.DropNamespaceSuiteBase {
trait DropNamespaceSuiteBase extends command.DropNamespaceSuiteBase
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, do we have tests for DROP NAMESPACE ... CASCADE in the suite?

Copy link
Contributor Author

@dchvn dchvn Jan 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It uses DROP NAMESPACE ... CASCADE test included in DropNamespaceSuiteBase, which it extends with, right @cloud-fan ?

with command.TestsV1AndV2Commands {
override protected def builtinTopNamespaces: Seq[String] = Seq("default")

override protected def namespaceAlias(): String = "database"
Expand All @@ -41,4 +42,6 @@ trait DropNamespaceSuiteBase extends command.DropNamespaceSuiteBase {
}
}

class DropNamespaceSuite extends DropNamespaceSuiteBase with CommandSuiteBase
class DropNamespaceSuite extends DropNamespaceSuiteBase with CommandSuiteBase {
override def commandVersion: String = super[DropNamespaceSuiteBase].commandVersion
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ import org.apache.spark.sql.execution.command.v1
*/
class DropNamespaceSuite extends v1.DropNamespaceSuiteBase with CommandSuiteBase {
override def isCasePreserving: Boolean = false
override def commandVersion: String = super[DropNamespaceSuiteBase].commandVersion
}