【问题标题】:Cassandra : Delete the data without removing the table structureCassandra:删除数据而不删除表结构
【发布时间】:2018-03-01 20:19:41
【问题描述】:

我正在 cassandra 上运行一些测试,每次运行后都需要删除表中的数据。所以我写了一个截断数据的脚本。我的问题是,在我 TRUNCATE 表之后,它是否使表处于未配置状态(删除所有列)?我是卡桑德拉初学者。需要对此有所了解。

【问题讨论】:

    标签: cassandra cql truncate cassandra-python-driver


    【解决方案1】:

    TRUNCATE 命令删除所有数据而不是架构

    TRUNCATE table_name;
    

    立即且不可逆地从指定表中删除所有数据,并从从该表派生的任何物化视图中删除所有数据。

    来源:https://docs.datastax.com/en/cql/3.3/cql/cql_reference/cqlTruncate.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-04-07
      • 1970-01-01
      • 2016-05-12
      • 2016-10-18
      • 2013-06-30
      • 2021-12-17
      • 2010-11-27
      • 1970-01-01
      相关资源
      最近更新 更多