How do I delete all data in a Cassandra column family?

后端 未结 6 918
长发绾君心
长发绾君心 2020-12-25 09:46

I\'m looking for a way to delete all of the rows from a given column family in cassandra.

This is the equivalent of TRUNCATE TABLE in SQL.

6条回答
  •  一个人的身影
    2020-12-25 10:11

    You can also do this via Cassandra CQL.

    $ cqlsh
    Connected to Test Cluster at localhost:9160.
    [cqlsh 4.1.1 | Cassandra 2.0.6 | CQL spec 3.1.1 | Thrift protocol 19.39.0]
    Use HELP for help.
    cqlsh> TRUNCATE my_keyspace.my_column_family;
    

提交回复
热议问题