Search code examples
cassandrahector

Hector: how to delete a composite colums inside a row


I have composite columns on the column family Tags

RowKey: A
=> (column=B:C, value=432b442b492b4b2b552b582b592b7465787433, timestamp=1338402672044003)
=> (column=C:D, value=442b492b4b2b552b582b592b7465787433, timestamp=1338402672044004)
=> (column=E:T, value=492b582b592b5a2b5a5a2b5a5a5a2b7465787434, timestamp=1338402672049002)

How could I delete in row A, column (C:D) for example

it seems:

Mutator<String> mutator = HFactory.createMutator(ks, se);
mutator.addDeletion(..

takes only 2 arguments the row and the CF


Solution

  • for people interested it's as easy as their creation;

    CompositeSerializer ce = new CompositeSerializer();
    Composite c = new Composite();
    c.add(0, "John");
    c.add(1, "Connor");
    mutator.addDeletion("key", "MyCF", c, ce);