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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With