Removes one or more views from the catalog and DataFusion session.
DROP VIEW [IF EXISTS] <name> [, <name> ...]
## 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.
| Name | Type | Description |
|---|---|---|
views | View names. | |
if_exists | Don't error if view doesn't exist. |
-- 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;