DROP MATERIALIZED TABLE Statement in Confluent Cloud for Apache Flink
The DROP MATERIALIZED TABLE statement removes a materialized table definition from Confluent Cloud for Apache Flink® and deletes its associated resources.
Syntax
DROP MATERIALIZED TABLE [IF EXISTS] [catalog_name.][db_name.]table_name
Parameters
IF EXISTSOptional clause that prevents an error if the materialized table does not exist.
table_nameThe name of the materialized table to drop.
Description
The DROP MATERIALIZED TABLE statement performs the following actions:
Stops the continuous query that powers the materialized table.
Removes the materialized table definition from the catalog.
Deletes the backing Apache Kafka® topic and its data permanently.
Deletes the associated schema versions from Schema Registry.
Important considerations
The
DROP MATERIALIZED TABLEoperation permanently deletes the Kafka topic data. This action cannot be undone.Running statements or other materialized tables that depend on the dropped materialized table are affected.
Stop dependent statements before dropping a materialized table.
Examples
-- Drop a materialized table.
DROP MATERIALIZED TABLE enriched_orders;
-- Drop a materialized table if it exists.
DROP MATERIALIZED TABLE IF EXISTS enriched_orders;