Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 77071 invoked from network); 26 Jul 2010 00:05:07 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 26 Jul 2010 00:05:07 -0000 Received: (qmail 68587 invoked by uid 500); 26 Jul 2010 00:05:05 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 68529 invoked by uid 500); 26 Jul 2010 00:05:05 -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 68521 invoked by uid 99); 26 Jul 2010 00:05:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Jul 2010 00:05:05 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,MIME_QP_LONG_LINE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [208.113.200.5] (HELO homiemail-a54.g.dreamhost.com) (208.113.200.5) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Jul 2010 00:04:58 +0000 Received: from homiemail-a54.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a54.g.dreamhost.com (Postfix) with ESMTP id 4DB343A406B for ; Sun, 25 Jul 2010 17:04:37 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=thelastpickle.com; h=to:from :subject:message-id:content-type:mime-version:in-reply-to:date; q=dns; s=thelastpickle.com; b=PFhIVqVHTEpl3sunlqE02AzKC3LSQavcv /m2/EF3CjUV/aacLfyPtaiZovu7x3FZY/si2gnTK754KbqKdWxPhMKu/wqriZsnx mjs+pj5Z61l3wSsl/6uMn43/IG31OjYIr/CIXAZ7JL2tT97VH2a1ISbznCw6f9m1 syhueQnyls= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=thelastpickle.com; h=to :from:subject:message-id:content-type:mime-version:in-reply-to: date; s=thelastpickle.com; bh=0PumVT8gC40Sv4uGqDRaLHFWZ8c=; b=Ib O+b7KlO8MP5Oly/Igk3IRWuRrjm13l93Dd1lMZfodd7wDXqgjcAEW2KWLz4PXXhs W3T/WAOoSRZ6rtDEzgr/3BAX/gKQbwBXRH3YeznHKGYaYvSlTgti85UqBPr1zmEk n+nqrxbB0LHUGVMy9bSuUQGynfEvvmVEAdF1B+m5E= Received: from localhost (webms.mac.com [17.148.16.116]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: aaron@thelastpickle.com) by homiemail-a54.g.dreamhost.com (Postfix) with ESMTPSA id 29C0F3A4065 for ; Sun, 25 Jul 2010 17:04:37 -0700 (PDT) To: user@cassandra.apache.org From: Aaron Morton Subject: Re: Can we filter a key or a column name using regular expression? X-Mailer: MobileMe Mail (1C262608) Message-id: Content-Type: multipart/alternative; boundary=Apple-Webmail-42--c67fd816-cc34-6dab-a21c-8649923afba7 MIME-Version: 1.0 In-Reply-To: Date: Sun, 25 Jul 2010 17:04:37 -0700 (PDT) --Apple-Webmail-42--c67fd816-cc34-6dab-a21c-8649923afba7 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8; format=flowed Have a look at how the SliceRange works for both get_slice and KeyRange w= orks for get_range_slices.=0A=0AYou can query for things that start with a= sub string but specifying a start value and an empty end value or an end = value that is the start value concatenated with the max ascii character. T= hen just make multiple calls, say getting 1000 cols/rows at a time.=0A=0AY= ou cannot do a "contains" type query, it's just byte/string matching. You'= ll need to think about how to store your data in a way that lets you get t= he same result. For example you could store the keys in the a Column Famil= y for "all" and a CF for ones that have a sub part. Or your could store ju= st "root@foo" as the key, then store columns for every child.=0A=0ANot gre= at examples but the general idea is to denormalise to support the queries.= =0A=0AHope that helps=0AAaron=0A=EF=BB=BF=0AOn 26 Jul, 2010,at 01:05 AM, M= iriam Allalouf wrote:=0A=0A> Hi,=0A> I need to= build a mode where I can retrieve an ordered list of objects=0A> sharing = the same prefix and contains a certain delimiter.=0A>=0A> For example: Get= all the object names that start with 'root' and=0A> contain '/' in it,=0A= > given the names:=0A> root@abc/ddd=0A> roo@bbb/c=0A> root@pppp=0A>=0A> sh= ould return the first two names (root@abc/ddd roo@bbb/c)=0A>=0A> I can bui= ld the model such that the a lot object name is a key or a column name.=0A= > Can we retrieve a key or a column name using such filter or other=0A> re= gular expression-like filters?=0A> Thanks and I will appreciate you help,=0A= > Miriam=0A --Apple-Webmail-42--c67fd816-cc34-6dab-a21c-8649923afba7 Content-Type: multipart/related; type="text/html"; boundary=Apple-Webmail-86--c67fd816-cc34-6dab-a21c-8649923afba7 --Apple-Webmail-86--c67fd816-cc34-6dab-a21c-8649923afba7 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=ISO-8859-1;
Have a look at how the SliceRange works  for both get_slice and = KeyRange works for get_range_slices.

You can query for things that= start with a sub string but specifying a start value and an empty end val= ue or an end value that is the start value concatenated with the max ascii= character. Then just make multiple calls, say getting 1000 cols/rows at a= time.

You cannot do a "contains" type query, it's just byte/strin= g matching. You'll need to think about how to store your data in a way tha= t lets you get the same result. For example you could store the keys in th= e a Column Family for "all" and a CF for ones that have a sub part. Or you= r could store just "root@foo" as the key, then store columns for every chi= ld.

Not great examples but the general idea is to denormalise to s= upport the queries.

Hope that helps
Aaron

On = 26 Jul, 2010,at 01:05 AM, Miriam Allalouf <miriam.allalouf@gmail.com>= ; wrote:

Hi,
=0AI need to build a mode where I can retrieve an ordered list of= objects
=0Asharing the same prefix and contains a certain delimiter.=0A
=0AFor example: Get all the object names that start with 'root' = and
=0Acontain '/' in it,
=0Agiven the names:
=0Aroot@abc/ddd
= =0Aroo@bbb/c
=0Aroot@pppp
=0A
=0Ashould return the first two name= s (root@abc/ddd roo@bbb/c)
=0A
=0AI can build the model such that t= he a lot object name is a key or a column name.
=0ACan we retrieve a k= ey or a column name using such filter or other
=0Aregular expression-li= ke filters?
=0AThanks and I will appreciate you help,
=0AMiriam
= =0A
--Apple-Webmail-86--c67fd816-cc34-6dab-a21c-8649923afba7-- --Apple-Webmail-42--c67fd816-cc34-6dab-a21c-8649923afba7--