How to pass TTL in Cassandra Java Driver QueryBuilder?
cassandra, datastax, insert, java, ttl
Solution
Finally figured it out, you have to pass in the static ttl() method on the QueryBuilder itself:
.using(ttl(30));
Problem
I am using the QueryBuilder in the Cassandra Java driver to insert some data. There seems to be no easy option to set the TTL on the row I am inserting. None of the examples on the DataStax site show an example with TTL. I suspect it has something to do with using() but once again, zero examples and minimal documentation in the code...