Cassandra “default_time_to_live” property is not deleting data

倖福魔咒の 提交于 2019-12-22 06:00:15

问题


I've created a table like:

CREATE TABLE IF NOT EXISTS metrics_second(
  timestamp timestamp,
  value counter,
  PRIMARY KEY ((timestamp))
) WITH default_time_to_live=1;

And inserted some data like:

UPDATE metrics_second SET value = value + 1 WHERE timestamp = '2015-01-22 17:43:55-0800';

When executing SELECT * FROM metrics_second I always see the data, even after a minute or so, although the default_time_to_live property of the table is set to one second. Why is that?


回答1:


As @RussS confirmed, unfortunately Cassandra doesn't support TTL on tables or rows when there are counters.

Even if default_time_to_live is being set when creating the table and no error is being returned, Cassandra won't enforce the TTL.



来源:https://stackoverflow.com/questions/28120834/cassandra-default-time-to-live-property-is-not-deleting-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!