Just set the TTL on a row

前端 未结 3 1396
迷失自我
迷失自我 2021-01-02 05:29

Using Java, can I scan a Cassandra table and just update the TTL of a row? I don\'t want to change any data. I just want to scan Cassandra table and set TTL of a few rows.

3条回答
  •  一个人的身影
    2021-01-02 06:02

    Alternatively, you can set a TTL value on the entire table while creating it.

    CREATE TABLE test (
        k text PRIMARY KEY,
        v int,
    ) WITH default_time_to_live = 63113904;
    

    Above example will create a table whose rows will disappear after 2 years.

提交回复
热议问题