Difference between UPDATE and INSERT in Cassandra?

后端 未结 4 1723
情歌与酒
情歌与酒 2020-12-28 12:06

What is the difference between UPDATE and INSERT when executing CQL against Cassandra?

It looks like there used to be no difference, but no

4条回答
  •  悲&欢浪女
    2020-12-28 12:32

    Another subtle difference (i'm starting to believe cql is a terrible interface to cassandra, full of subtleties and caveats due to using similar SQL syntax but slightly different semantics) is with setting TTLs on existing data. With UPDATE you cannot update the TTL of the keys, even if the new actual values are equal to the old values. The solution is to INSERT the new row instead, with the new TTL already set

提交回复
热议问题