CREATE SCHEMA

Creates a new schema namespace within a zone.

Category: catalogDeltaForge extension

Syntax

CREATE SCHEMA [IF NOT EXISTS] <zone.schema> [COMMENT '<desc>']

Description

## Overview Creates a schema within an existing zone. Schemas are the second level of the DeltaForge three-level namespace (zone.schema.table). They organize tables into logical groups such as landing, staging, curated, or reporting. ## Behavior - The zone referenced in the first part of the qualified name must already exist. If it does not, the command fails with an error. - Schema names must be unique within their parent zone. - If IF NOT EXISTS is specified and the schema already exists (409 Conflict from the control plane), the statement completes successfully without modification. - If IF NOT EXISTS is omitted and the schema already exists, the command returns an error. - The command is routed through the control plane catalog API. A valid catalog router connection is required. - The creating principal is recorded as the schema owner. ## Compatibility CREATE SCHEMA follows standard SQL naming conventions but uses the DeltaForge two-part zone.schema qualifier rather than a standalone schema name. This is a DeltaForge extension.

Examples

-- Create a raw landing schema in the bronze zone
CREATE SCHEMA bronze.raw;
-- Create a schema only if it does not already exist
CREATE SCHEMA IF NOT EXISTS silver.curated;
-- Create a schema with a descriptive comment
CREATE SCHEMA IF NOT EXISTS gold.analytics COMMENT 'Aggregated metrics for dashboards';
-- Set up a multi-zone medallion architecture
CREATE ZONE IF NOT EXISTS bronze;
CREATE ZONE IF NOT EXISTS silver;
CREATE ZONE IF NOT EXISTS gold;
CREATE SCHEMA bronze.landing;
CREATE SCHEMA silver.cleaned;
CREATE SCHEMA gold.reporting;

Pitfalls

See Also

Open in interactive docs →   DeltaForge home →