Skip to content

CASCADE WITH Drop Namespace Gives exception #8529

@vinitamaloo-asu

Description

@vinitamaloo-asu

Apache Iceberg version

1.3.1 (latest release)

Query engine

Spark

Please describe the bug 🐞

Running this command with:
spark.sql(DROP DATABASE IF EXISTS dbname CASCADE)

Gives the below exception:
org.apache.iceberg.exceptions.NamespaceNotEmptyException: Namespace dbname is not empty. One or more tables exist. at org.apache.iceberg.hive.HiveCatalog.dropNamespace(HiveCatalog.java:353) at org.apache.iceberg.spark.SparkCatalog.dropNamespace(SparkCatalog.java:447) at org.apache.spark.sql.execution.datasources.v2.DropNamespaceExec.run(DropNamespaceExec.scala:52) at org.apache.spark.sql.execution.datasources.v2.V2CommandExec.result$lzycompute(V2CommandExec.scala:40) at org.apache.spark.sql.execution.datasources.v2.V2CommandExec.result(V2CommandExec.scala:40) at org.apache.spark.sql.execution.datasources.v2.V2CommandExec.executeCollect(V2CommandExec.scala:46)

The expectation is that with CASCADE specified, command should delete all tables and the db itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions