I thought I would give this exercise a try.
aploetz@cqlsh:presentation> SELECT * FROm bladerunners WHERE id='B26354';
id | data | name | ts | type
--------+---------------------+--------------+--------------------------+--------------
B26354 | Filed and monitored | Rick Deckard | 2015-02-16 12:00:03-0600 | Blade Runner
(1 rows)
Here is a look at how the data is stored, using the cassandra-cli:
[default@presentation] get bladerunners[B26354];
=> (name=, value=, timestamp=1427744637894310)
=> (name=data, value=46696c656420616e64206d6f6e69746f7265642e, timestamp=1427744637894310)
=> (name=name, value=5269636b204465636b617264, timestamp=1427744637894310)
=> (name=ts, value=0000014b938c09a2, timestamp=1427744637894310)
=> (name=type, value=426c6164652052756e6e6572, timestamp=1427744637894310)
Returned 5 results.
Elapsed time: 7.67 msec(s).
I will now delete the data column for this row, generating a tombstone:
DELETE data FROM bladerunners WHERE id='B26354';
When I SELECT with tracing on I can see that the column shows "null" and I have a tombstone out there.
aploetz@cqlsh:presentation> SELECT * FROM bladerunners WHERe id='B26354';
id | data | name | ts | type
--------+------+--------------+--------------------------+--------------
B26354 | null | Rick Deckard | 2015-02-16 12:00:03-0600 | Blade Runner
...
Read 1 live and 1 tombstoned cells [SharedPool-Worker-2] | 2015-06-10 08:42:25.858000 | 192.168.23.129 | 2173
So I will set the bladerunners table's gc_grace_seconds to zero:
ALTER TABLE bladerunners WITH gc_grace_seconds=0;
From the (Linux) command line, I will flush and compact my presentation keyspace:
aploetz@dockingBay94:/local/dsc-cassandra-2.1.4$ bin/nodetool flush
aploetz@dockingBay94:/local/dsc-cassandra-2.1.4$ bin/nodetool compact presentation
When I SELECT with tracing on, I can see that the data column is still "null," but now the tombstone is gone.
I will now re-INSERT the data column with a timestamp of 1:
INSERT INTO bladerunners (id, data) VALUES ('B26354','Filed and monitored') USING TIMESTAMP 1;
When querying with the cassandra-cli, this is now what I see:
[default@presentation] get bladerunners[B26354];
=> (name=, value=, timestamp=1427744637894310)
=> (name=data, value=46696c656420616e64206d6f6e69746f726564, timestamp=1)
=> (name=name, value=5269636b204465636b617264, timestamp=1427744637894310)
=> (name=ts, value=0000014b938c09a2, timestamp=1427744637894310)
=> (name=type, value=426c6164652052756e6e6572, timestamp=1427744637894310)
Returned 5 results.
Elapsed time: 4.7 msec(s).
Note that the data column now has a timestamp of 1.
Try running your query with tracing on and see if your tombstones are really gone. Also, check your table via the cassandra-cli to see how the timestamps are coming through. Let me know if you need clarification on any of these steps.
NOTE: I was just showing the flush/compact as part of the example or exercise. I feel compelled to mention that DataStax recommends that users avoid manually running nodetool compact if at all possible.