Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D35BF98F8 for ; Thu, 23 Feb 2012 07:09:17 +0000 (UTC) Received: (qmail 73864 invoked by uid 500); 23 Feb 2012 07:09:15 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 73678 invoked by uid 500); 23 Feb 2012 07:09:12 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 73647 invoked by uid 99); 23 Feb 2012 07:09:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Feb 2012 07:09:11 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FSL_RCVD_USER,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of praveen.baratam@gmail.com designates 74.125.82.44 as permitted sender) Received: from [74.125.82.44] (HELO mail-ww0-f44.google.com) (74.125.82.44) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Feb 2012 07:09:05 +0000 Received: by wgbdt10 with SMTP id dt10so605934wgb.25 for ; Wed, 22 Feb 2012 23:08:44 -0800 (PST) Received-SPF: pass (google.com: domain of praveen.baratam@gmail.com designates 10.180.107.2 as permitted sender) client-ip=10.180.107.2; Authentication-Results: mr.google.com; spf=pass (google.com: domain of praveen.baratam@gmail.com designates 10.180.107.2 as permitted sender) smtp.mail=praveen.baratam@gmail.com; dkim=pass header.i=praveen.baratam@gmail.com Received: from mr.google.com ([10.180.107.2]) by 10.180.107.2 with SMTP id gy2mr426005wib.12.1329980924298 (num_hops = 1); Wed, 22 Feb 2012 23:08:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=YsQWLQWZCjhoyF6pmR3gOVLmTOOlsTzuolSmfPuJp/w=; b=YcLjza5OO2d+RTER4XSET3YwP6h+Fy/grwqFl43O0KVbx4uEKoVBjVF3b4NqBJndf7 y0D9xFSn1qWe/wuh4gGw/FkyGmLRMXBC72TY+rQitiHCYOrghud6wqXX6SPgEXTnfvi3 ddIc8AhStkgdDRlQpR/OMx/IeOOPZJMAFyf2c= Received: by 10.180.107.2 with SMTP id gy2mr343348wib.12.1329980924211; Wed, 22 Feb 2012 23:08:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.180.126.41 with HTTP; Wed, 22 Feb 2012 23:08:24 -0800 (PST) In-Reply-To: References: From: Praveen Baratam Date: Thu, 23 Feb 2012 12:38:24 +0530 Message-ID: Subject: Re: How to delete a range of columns using first N components of CompositeType Column? To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=e89a8f3b9f658bb0f504b99c50f5 --e89a8f3b9f658bb0f504b99c50f5 Content-Type: text/plain; charset=ISO-8859-1 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 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? > --e89a8f3b9f658bb0f504b99c50f5 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable More precisely,

Lets say we have a CF with the following= spec.

create column family Test
= =A0 =A0 with comparator =3D 'CompositeType(UTF8Type,UTF8Type,UTF8Type)&= #39;
=A0 =A0 and key_validation_class =3D 'UTF8Type'
=A0 = =A0 and default_validation_class =3D 'UTF8Type'; =A0 =A0
=
And I have columns such as:

Jack:Na= me:First - Jackson
Jack:Name:Last - =A0Samuel
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', &= #39;Jack:Name:Last', 'Jack:Age' from Test where KEY =3D "f= riends";

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 'Ja= ck' from Test where KEY =3D "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 ver= y convenient to query for a range of columns using the First N compo= nents but how do I delete a range of columns using the First N components o= f the CompositeType column.

In order to specify the exact column names to delete, I woul= d have to read first and then delete.

Is there a b= etter way?

--e89a8f3b9f658bb0f504b99c50f5--