Drops a schema (fails if it contains tables).
DROP SCHEMA [IF EXISTS] <zone.schema>
## Overview Removes a schema from the control plane catalog. The schema is identified by its fully qualified two-part name (zone.schema). Once dropped, the schema and its namespace are no longer available for table registration or queries. ## Behavior - The schema must be empty (contain no registered tables). If tables remain in the schema, the command fails with an error. Unregister or drop all tables first. - If IF EXISTS is specified and the schema does not exist in the catalog, the statement completes successfully without error. - If IF EXISTS is omitted and the schema does not exist, the command returns a SchemaNotFound error. - The command is routed through the control plane catalog API. A valid catalog router connection is required. - Dropping a schema does not affect underlying data files. It only removes the catalog metadata. ## Compatibility DROP SCHEMA follows standard SQL conventions but uses the DeltaForge two-part zone.schema qualifier. This is a DeltaForge extension.
-- Drop a schema from the bronze zone
DROP SCHEMA bronze.temp;
-- Drop a schema only if it exists, avoiding errors
DROP SCHEMA IF EXISTS silver.staging;
-- Clean up an entire zone by dropping its schemas first
DROP SCHEMA IF EXISTS gold.deprecated_reports;
DROP SCHEMA IF EXISTS gold.legacy_metrics;