DROP TOPIC

Syntax

DROP TOPIC
    topic_name
    [IN STORE store_name];

Description

Drops a Topic from the user's default Store, or a provided Store name. A Topic cannot be dropped if any relations are defined that depend on it. However, a Topic may be dropped outside of the DeltaStream platform; in which case, the streams and queries that depend on it, will fail to progress.

See USE for changing user's default Store.

DROP TOPIC cannot be undone. Use it with care!

Arguments

topic_name

The name of the Topic to drop. For case-sensitive names, the name must be wrapped in double quotes, otherwise, the lowercased name will be used.

IN STORE store_name

Optionally, this specifies the Store from which the Topic should be dropped. For case-sensitive names, the name must be wrapped in double quotes, otherwise, the lowercased name will be used.

Examples

Drop a Topic in the default Store

The following drops a Topic from the user's default Store. Note the Store name, demostore, in the CLI prompt to indicate which Store is being used as default:

demodb.public/demostore# LIST TOPICS;

   Topic name
----------------
  pageviews
  pageviews_pb
  customers

demodb.public/demostore# DROP TOPIC customers;
demodb.public/demostore# LIST TOPICS;

   Topic name
----------------
  pageviews
  pageviews_pb

Drop a Topic in a specific Store

The following drops a Topic in a specific store. Note that we specify a store, AltStore, to LIST TOPICS command as well as the DROP TOPIC DDL statement:

demodb.public/demostore# LIST TOPICS IN STORE "AltStore";

   Topic name
----------------
  Shipments
  reviews

demodb.public/demostore# DROP TOPIC "Shipments" IN STORE "AltStore";
demodb.public/demostore# LIST TOPICS IN STORE "AltStore";

   Topic name
----------------
  reviews

Last updated