cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aaron morton <aa...@thelastpickle.com>
Subject Re: How to delete a range of columns using first N components of CompositeType Column?
Date Sun, 26 Feb 2012 19:28:20 GMT
it has been discussed a few times :)

https://issues.apache.org/jira/browse/CASSANDRA-494

A

-----------------
Aaron Morton
Freelance Developer
@aaronmorton
http://www.thelastpickle.com

On 25/02/2012, at 8:06 AM, Praveen Baratam wrote:

> Thank you Aaron for the clarification. 
> 
> May be this could be a feature that Cassandra team should consider implementing. Instead
of two network round trips the logic could be consolidated on the server side if read before
range delete is unavoidable. 
> 
> On Fri, Feb 24, 2012 at 12:46 AM, aaron morton <aaron@thelastpickle.com> wrote:
> Unfortunately you can use column ranges for delete operations. 
> 
> So while what you want to do is something like...
> 
> Delete 'Jack:*:*'...'Jack:*:*' from Test where KEY = "friends";
> 
> You cannot do it. 
> 
> You need to read and then delete by name.
> 
> Cheers
> 
> -----------------
> Aaron Morton
> Freelance Developer
> @aaronmorton
> http://www.thelastpickle.com
> 
> On 23/02/2012, at 8:08 PM, Praveen Baratam wrote:
> 
>> More precisely,
>> 
>> Lets say we have a CF with the following spec.
>> 
>> create column family Test
>>     with comparator = 'CompositeType(UTF8Type,UTF8Type,UTF8Type)'
>>     and key_validation_class = 'UTF8Type'
>>     and default_validation_class = 'UTF8Type';    
>> 
>> And I have columns such as:
>> 
>> Jack:Name:First - Jackson
>> Jack:Name:Last -  Samuel
>> Jack:Age - 50
>> 
>> Now To delete all columns related to Jack, I need to use as far as I can comprehend
>> 
>> Delete 'Jack:Name:First', 'Jack:Name:Last', 'Jack:Age' from Test where KEY = "friends";
>> 
>> The problem is we do not usually know what meta-data is associated with a user as
it may include Timestamp based columns.
>> 
>> such as: Jack:1234567890:Location - Chicago
>> 
>> Can something like -
>> 
>> Delete 'Jack' from Test where KEY = "friends";
>> 
>> be done using the First N components of the CompositeType?
>> 
>> Or should we read first and then delete?
>> 
>> Thank You.
>> 
>> On Thu, Feb 23, 2012 at 4:47 AM, Praveen Baratam <praveen.baratam@gmail.com>
wrote:
>> I am using CompositeType columns and its very convenient to query for a range of
columns using the First N components but how do I delete a range of columns using the First
N components of the CompositeType column.
>> 
>> In order to specify the exact column names to delete, I would have to read first
and then delete.
>> 
>> Is there a better way?
>> 
> 
> 


Mime
View raw message