Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cassandra cql delete using a less than operator on a secondary key

Tags:

cassandra

cql

I have a table similar to this

{
  CREATE TABLE timeseries (
    event_type text,
    insertion_time timestamp,
    event blob,
    PRIMARY KEY (event_type, insertion_time)
  )
}

and I am trying to do

delete * from timseries where event_type='xxx' and insertion_time <'12345';

Bad Request: Invalid operator LT for PRIMARY KEY part insertion_time.

Does cassandra support these kind of deletes ? Any help is appreciated.

like image 612
KIRAN SUGANA Avatar asked Oct 15 '13 20:10

KIRAN SUGANA


2 Answers

No, range deletes are not supported.

For what is support, look at the CQL3 documentation:

http://cassandra.apache.org/doc/cql3/CQL.html

like image 196
Aurand Avatar answered Oct 26 '22 05:10

Aurand


Note that range deletes (on the cluster key) are in the next major version (3.0-beta2). Patch got committed to trunk just recently: https://issues.apache.org/jira/browse/CASSANDRA-6237

like image 31
ostefano Avatar answered Oct 26 '22 06:10

ostefano