DROP VIEW

Removes one or more views from the catalog and DataFusion session.

Category: ddl

Syntax

DROP VIEW [IF EXISTS] <name> [, <name> ...]

Description

## Overview Removes one or more views from the catalog and the DataFusion session. Views are virtual objects with no underlying data; dropping them removes only the query definition. ## Behavior - For 3-part qualified view names, the catalog entry is removed first via the CatalogRouter. - The view is then dropped from the DataFusion session. - Multiple view names can be specified in a single statement. Each is processed independently. - If IF EXISTS is specified, views that do not exist are silently skipped. - Without IF EXISTS, attempting to drop a nonexistent view returns an error. ## Compatibility DROP VIEW is a standard SQL operation. It removes only the view definition; underlying tables referenced by the view are not affected.

Parameters

NameTypeDescription
viewsView names.
if_existsDon't error if view doesn't exist.

Examples

-- Drop a single view
DROP VIEW warehouse.sales.active_customers;
-- Drop a view only if it exists
DROP VIEW IF EXISTS warehouse.sales.temp_report;
-- Drop multiple views at once
DROP VIEW warehouse.sales.daily_summary, warehouse.sales.weekly_summary;

Pitfalls

See Also

Open in interactive docs →   DeltaForge home →