DROP SCHEMA COLUMNS

Removes column metadata for a specific table or cleans up orphaned column records.

Category: catalogDeltaForge extension

Syntax

DROP SCHEMA COLUMNS FOR TABLE <table> | DROP SCHEMA COLUMNS ORPHANS

Description

## Overview Removes column-level schema metadata from the control plane catalog. This command operates in two modes: 1. **Table mode**: Specify a table name to remove all column records for that table. This is useful before re-running DETECT SCHEMA to get a clean re-scan. 2. **Orphans mode**: Use the ORPHANS keyword to remove column records whose parent table has been unregistered or dropped. This cleans up stale metadata left behind when tables are removed without first clearing their column data. ## Behavior - In table mode, the command deletes all column metadata entries associated with the specified table and returns the count of removed records. - In orphans mode, the command scans all column records and removes those whose parent table no longer exists in the catalog. It returns the count of cleaned-up records. - The command is routed through the control plane catalog API. A valid catalog router connection is required. - This operation does not affect the table itself, its data files, or its registration in the catalog. Only the column metadata is removed. ## Compatibility DROP SCHEMA COLUMNS is a DeltaForge extension for managing catalog column metadata. There is no ANSI SQL equivalent.

Examples

-- Remove all column metadata for a specific table
DROP SCHEMA COLUMNS FOR TABLE external.csv.sales;
-- Remove column metadata without the optional TABLE keyword
DROP SCHEMA COLUMNS FOR bronze.landing.events;
-- Clean up orphaned column records across the entire catalog
DROP SCHEMA COLUMNS ORPHANS;
-- Re-detect schema after dropping stale column metadata
DROP SCHEMA COLUMNS FOR TABLE silver.curated.customers;
DETECT SCHEMA FOR TABLE silver.curated.customers;

Pitfalls

See Also

Open in interactive docs →   DeltaForge home →