Small question regarding Cassandra please.
I have created a table as follow:
CREATE TABLE contract ( contractidentifier text, name text, telephone text, idnumber text, companyid text, company text, startdate timestamp, hiringdate timestamp, interviewdate timestamp,
PRIMARY KEY (contractidentifier, company, name)) WITH default_time_to_live = 2628000;
And the goal is very straightforward, the web application is just going to write some data about some short term contracts which only last for one month.
Since the employment is only a month long, what I would like to achieve from the table point of view is: "keep only the data for one month only. After that, it should be deleted".
With this requirement in mind, I simply used the TTL feature of Cassandra (see query, WITH default_time_to_live = 2628000).
Now, I come back after once month, expecting the data to be deleted. However, I can see the data is still there, with some null values:
C102403845 | null | null | SMITH | null | null | null | null | DELL | null | null | null | null | null | null
Questions:
What is the issue here please? Did I misunderstood the purpose of the TTL? (i.e. My understanding of the TTL is that the row will be entirely deleted after one month, not: the row is still after one month, with only some of the values being null)
If my understanding is correct, did I misconfigured something?
Finally, if the TTL is actually not the solution, what else could I use please?
Thank you