Deleting table/keyspace with schema (DROP)

Suppose that you decided to scrap an entire application that uses a particular keyspace, or replace a particular table with a new table. You might want to delete an entire keyspace (along with the tables) or an entire table along with the schema respectively. To perform these operations, CQL protocol provides the DROP KEYSPACE and DROP TABLE functions:

DROP KEYSPACE "my_status"; DROP TABLE "users";

Dropping a keyspace schema will delete the data as well as the schema of all the tables within the keyspace.

The effect of the TRUNCATE and DROP statements is not reversible. Data that has been deleted cannot be recovered. Also, data doesn't get deleted immediately. It gets removed during a compaction ...

Get Learning Apache Cassandra - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.