From user-return-19425-apmail-cassandra-user-archive=cassandra.apache.org@cassandra.apache.org Wed Aug 3 01:51:04 2011 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 51A30653E for ; Wed, 3 Aug 2011 01:51:04 +0000 (UTC) Received: (qmail 97887 invoked by uid 500); 3 Aug 2011 01:51:01 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 97803 invoked by uid 500); 3 Aug 2011 01:51:01 -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 97795 invoked by uid 99); 3 Aug 2011 01:51:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Aug 2011 01:51:01 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of tyler@datastax.com designates 209.85.213.172 as permitted sender) Received: from [209.85.213.172] (HELO mail-yx0-f172.google.com) (209.85.213.172) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Aug 2011 01:50:54 +0000 Received: by yxp4 with SMTP id 4so244059yxp.31 for ; Tue, 02 Aug 2011 18:50:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.166.7 with SMTP id o7mr78254ybe.98.1312336233297; Tue, 02 Aug 2011 18:50:33 -0700 (PDT) Received: by 10.150.51.11 with HTTP; Tue, 2 Aug 2011 18:50:33 -0700 (PDT) X-Originating-IP: [70.124.83.21] In-Reply-To: <13469620-96CE-415E-861E-BA8524C4C7D2@thelastpickle.com> References: <13469620-96CE-415E-861E-BA8524C4C7D2@thelastpickle.com> Date: Tue, 2 Aug 2011 20:50:33 -0500 Message-ID: Subject: Re: HOW TO select a column or all columns that start with X From: Tyler Hobbs To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=000e0cd4cbbc02f99004a99017ab X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd4cbbc02f99004a99017ab Content-Type: text/plain; charset=ISO-8859-1 A minor correction: To get all columns starting with "ABC_", you would set column_start="ABC_" and column_finish="ABC`" (the '`' character comes after '_'), and ignore the last column in your results if it happened to be "ABC`". column_finish, or the "slice end" in other clients, is inclusive. You could of course use "ABC_~" as column_finish and avoid the check if you know that you don't have column names like "ABC_~FOO" that you want to include. On Tue, Aug 2, 2011 at 7:17 PM, aaron morton wrote: > Yup, thats a pretty common pattern. How exactly depends on the client you > are using. > > Say you were using pycassam, you would do a get() > http://pycassa.github.com/pycassa/api/pycassa/columnfamily.html#pycassa.columnfamily.ColumnFamily.get > > with column_start="ABC_" , count to whatever, and column_finish not > provided. > > You can also provide a finish and use the highest encoded character, e.g. > ascii 126 is ~ so if you used column_finish = "ABC_~" you would get > everything that starts with ABC_ > > Cheers > > ----------------- > Aaron Morton > Freelance Cassandra Developer > @aaronmorton > http://www.thelastpickle.com > > On 3 Aug 2011, at 09:28, Eldad Yamin wrote: > > Hello, > I wonder if I can select a column or all columns that start with X. > E.g I have columns ABC_1, ABC_2, ZZZ_1 and I want to select all columns > that start with ABC_ - is that possible? > > > > Thanks! > > > -- Tyler Hobbs Software Engineer, DataStax Maintainer of the pycassa Cassandra Python client library --000e0cd4cbbc02f99004a99017ab Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable A minor correction:

To get all columns starting with "ABC_"= ;, you would set column_start=3D"ABC_" and column_finish=3D"= ABC`" (the '`' character comes after '_'), and ignore = the last column in your results if it happened to be "ABC`".

column_finish, or the "slice end" in other clients, is inclus= ive.=A0 You could of course use "ABC_~" as column_finish and avoi= d the check if you know that you don't have column names like "ABC= _~FOO" that you want to include.

On Tue, Aug 2, 2011 at 7:17 PM, aaron morton= <aaron@the= lastpickle.com> wrote:
Yup, thats a pretty common pattern. How= exactly depends on the client you are using.=A0


with column_start=3D"ABC_" , count to whateve= r, and column_finish not provided.=A0

You can also= provide a finish and use the highest encoded character, e.g. ascii 126 is = ~ so if you used column_finish =3D "ABC_~" you would get everythi= ng that starts with ABC_

Cheers

-----------------
Aaron Morton
Freelance Cass= andra Developer
@aaronmorton

On 3 Aug 2011, at 09:28, Eldad Yamin wrote:

Hello,
I wonder if I can select a co= lumn or all columns that start with X.
E.g I have columns ABC_1, = ABC_2, ZZZ_1 and I want to select all columns that start with ABC_ - is tha= t possible?



Thanks!




--
Tyler Hobbs Software Engineer, DataS= tax
Maintainer of the pycassa Cassandra Python client library
--000e0cd4cbbc02f99004a99017ab--