You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Tyler Hobbs <ty...@datastax.com> on 2014/10/17 00:27:58 UTC

Re: Deleting data in 1.2.8 based on time stamp

For each partition in the table, run:

DELETE FROM mytable WHERE partitionkey=? USING TIMESTAMP 123456789

And it will delete everything older than or equal to 123456789 (in
microseconds since the epoch, if you're using standard timestamps).

On Thu, Oct 16, 2014 at 5:09 PM, Rahul Neelakantan <ra...@rahul.be> wrote:

> Does anyone know of a way to delete rows from C* 1.2.8 based on the
> timestamp (time from epoch) that is present on each column in the triplet
> of name, value and timestamp? (I do not have a separate date/timestamp
> column that I insert)
>
> Rahul Neelakantan




-- 
Tyler Hobbs
DataStax <http://datastax.com/>

Re: Deleting data in 1.2.8 based on time stamp

Posted by Tyler Hobbs <ty...@datastax.com>.
On Thu, Oct 16, 2014 at 5:32 PM, Rahul Neelakantan <ra...@rahul.be> wrote:

> So this would need me to know the partition keys, what if I simply wanted
> to say delete all rows where the timestamp was older than 123456789?


You can't.  You'll need to loop over the table and collect the keys.

-- 
Tyler Hobbs
DataStax <http://datastax.com/>

Re: Deleting data in 1.2.8 based on time stamp

Posted by Rahul Neelakantan <ra...@rahul.be>.
So this would need me to know the partition keys, what if I simply wanted to say delete all rows where the timestamp was older than 123456789? 


Rahul Neelakantan

> On Oct 16, 2014, at 6:27 PM, Tyler Hobbs <ty...@datastax.com> wrote:
> 
> For each partition in the table, run:
> 
> DELETE FROM mytable WHERE partitionkey=? USING TIMESTAMP 123456789
> 
> And it will delete everything older than or equal to 123456789 (in microseconds since the epoch, if you're using standard timestamps).
> 
>> On Thu, Oct 16, 2014 at 5:09 PM, Rahul Neelakantan <ra...@rahul.be> wrote:
>> Does anyone know of a way to delete rows from C* 1.2.8 based on the timestamp (time from epoch) that is present on each column in the triplet of name, value and timestamp? (I do not have a separate date/timestamp column that I insert)
>> 
>> Rahul Neelakantan
> 
> 
> 
> -- 
> Tyler Hobbs
> DataStax