TTL() function displays null instead of 0 after JOOQ upgrade

39 Views Asked by At

Select statement using TTL: EX:

SELECT value, ttl(value), last_modified
FROM test.tblTTLINORDERBY
WHERE useruid = ‘userid1' AND direction IN ('out', 'in');

Before the JOOQ upgrade, if we do not use the TTL value when inserting data and then check the TTL value using a select query, it will display the values as 0.

After the JOOQ upgrade(3.9.1 -> 3.17.x), if we do not use the TTL value when inserting data and then check the TTL value using a select query, it will display the values as null.

Are you considering 0 and null as equivalent in this scenario?

1

There are 1 best solutions below

0
Erick Ramirez On

When data is not set to expire, it has a TTL() value of null. If data previously had a TTL set, it is possible to override/remove the expiry by setting a TTL of 0. This means that 0 and null are interchangeable and mean the same thing.

As a bit of background, this has been made consistent in Cassandra 3.10 so it is possible to set the TTL with either 0 or null (CASSANDRA-12216). Cheers!