You can set the TTL on a row when you create it using an INSERT statement.
For example:

INSERT INTO mytable (partitionkey, clusteringkey) VALUES (0, 0) USING TTL
100;

However, Cassandra doesn't support the ttl() function on primary key
columns yet.  The ticket to support this is
https://issues.apache.org/jira/browse/CASSANDRA-9312.

On Tue, Aug 4, 2015 at 9:22 PM, Kevin Burton <bur...@spinn3r.com> wrote:

> I have a table which just has primary keys.
>
> basically:
>
> create table foo (
>
>     sequence bigint,
>     signature text,
>     primary key( sequence, signature )
> )
>
> I need these to eventually get GCd however it doesn’t seem to work.
>
> If I then run:
>
> select ttl(sequence) from foo;
>
> I get:
>
> Cannot use selection function ttl on PRIMARY KEY part sequence
>
> …
>
> I get the same thing if I do it on the second column .. (signature).
>
> And the value doesn’t seem to be TTLd.
>
> What’s the best way to proceed here?
>
>
> --
>
> Founder/CEO Spinn3r.com
> Location: *San Francisco, CA*
> blog: http://burtonator.wordpress.com
> … or check out my Google+ profile
> <https://plus.google.com/102718274791889610666/posts>
>
>


-- 
Tyler Hobbs
DataStax <http://datastax.com/>

Reply via email to