KIRAN SUGANA
KIRAN SUGANA

Reputation: 101

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

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.

Upvotes: 10

Views: 5204

Answers (3)

ostefano
ostefano

Reputation: 505

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

Upvotes: 6

mck
mck

Reputation: 1150

do a select first, then delete each result.

Upvotes: 4

Aurand
Aurand

Reputation: 5547

No, range deletes are not supported.

For what is support, look at the CQL3 documentation:

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

Upvotes: 11

Related Questions