CQL for Cassandra 1.2

TRUNCATE

Remove all data from a table.

Synopsis

        TRUNCATE
        keyspace_name.
        table_name
      

Synopsis Legend

  • Uppercase means literal
  • Lowercase means not literal
  • Italics mean optional
  • The pipe (|) symbol means OR or AND/OR
  • Ellipsis (...) means repeatable
  • « means a non-literal, open parenthesis used to indicate scope
  • » means a non-literal, close parenthesis used to indicate scope

A semicolon that terminates CQL statements is not included in the synopsis.

Description

A TRUNCATE statement results in the immediate, irreversible removal of all data in the named table.

Truncating a table triggers an automatic snapshot, which backs up the data only, not the schema.

Examples

TRUNCATE user_activity;
Show/hide