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 3BC8A786E for ; Wed, 3 Aug 2011 12:04:28 +0000 (UTC) Received: (qmail 34989 invoked by uid 500); 3 Aug 2011 12:04:24 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 34965 invoked by uid 500); 3 Aug 2011 12:04:19 -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 34957 invoked by uid 99); 3 Aug 2011 12:04:16 -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 12:04:16 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.113.200.5] (HELO homiemail-a52.g.dreamhost.com) (208.113.200.5) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Aug 2011 12:04:09 +0000 Received: from homiemail-a52.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a52.g.dreamhost.com (Postfix) with ESMTP id AC0696B822C for ; Wed, 3 Aug 2011 05:03:43 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=thelastpickle.com; h=from :mime-version:content-type:subject:date:in-reply-to:to :references:message-id; q=dns; s=thelastpickle.com; b=BSG09UxRMz ypN78016MyCpdZSCtjZF42OpYB3XRS0XDXPq0OQxQZ5pcXKCg8kaLt5otbEoamla lzjAgzEtRO+9UfYIC1weFB1wTRydazfYvtyclOnXgrzgaLJEtnvQPOXDcny4h02F f3Ij5WYKwwBLbrm4sNrCoOatRegfaty00= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=thelastpickle.com; h=from :mime-version:content-type:subject:date:in-reply-to:to :references:message-id; s=thelastpickle.com; bh=DjSwe8UStCOhbIRd UdimhC41GPc=; b=PF89LfgqWCjQLH330tyGzWmdX/AXGgfv9nzgGtUKQ4ydDFX9 OD943HKD+zCIfydIHHD2/llMRzL8ZbKaYnRvKpoZb5WaXJHuIl12j7OkCT4arS2n /uzchezPRvnnl/MLTH7v3LsmvPtlnWRtdDccKy71HVM/RWhdmIrUmgjyMIk= Received: from [192.168.0.101] (CPE-124-191-124-91.pmql1.win.bigpond.net.au [124.191.124.91]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: aaron@thelastpickle.com) by homiemail-a52.g.dreamhost.com (Postfix) with ESMTPSA id D03496B810B for ; Wed, 3 Aug 2011 05:03:42 -0700 (PDT) From: aaron morton Mime-Version: 1.0 (Apple Message framework v1244.3) Content-Type: multipart/alternative; boundary="Apple-Mail=_1D8473B6-9B9C-4B55-AB71-78D66B5BB061" Subject: Re: HOW TO select a column or all columns that start with X Date: Wed, 3 Aug 2011 22:03:38 +1000 In-Reply-To: To: user@cassandra.apache.org References: <13469620-96CE-415E-861E-BA8524C4C7D2@thelastpickle.com> Message-Id: X-Mailer: Apple Mail (2.1244.3) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_1D8473B6-9B9C-4B55-AB71-78D66B5BB061 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 and AsciiType ----------------- Aaron Morton Freelance Cassandra Developer @aaronmorton http://www.thelastpickle.com On 3 Aug 2011, at 16:35, eldad87 wrote: > Thank you! > Will this situation work only for UTF8Type comparator? >=20 >=20 > On Wed, Aug 3, 2011 at 4:50 AM, Tyler Hobbs = wrote: > A minor correction: >=20 > 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`". >=20 > 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. >=20 >=20 > 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.=20 >=20 > Say you were using pycassam, you would do a get() = http://pycassa.github.com/pycassa/api/pycassa/columnfamily.html#pycassa.co= lumnfamily.ColumnFamily.get >=20 > with column_start=3D"ABC_" , count to whatever, and column_finish not = provided.=20 >=20 > 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 everything that starts with ABC_ >=20 > Cheers >=20 > ----------------- > Aaron Morton > Freelance Cassandra Developer > @aaronmorton > http://www.thelastpickle.com >=20 > On 3 Aug 2011, at 09:28, Eldad Yamin wrote: >=20 >> 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? >>=20 >>=20 >>=20 >> Thanks! >=20 >=20 >=20 >=20 > --=20 > Tyler Hobbs > Software Engineer, DataStax > Maintainer of the pycassa Cassandra Python client library >=20 >=20 --Apple-Mail=_1D8473B6-9B9C-4B55-AB71-78D66B5BB061 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=iso-8859-1
http://www.thelastpickle.com

On 3 Aug 2011, at 16:35, eldad87 wrote:

Thank you!
Will this situation work only = for UTF8Type comparator?


On Wed, Aug 3, 2011 at 4:50 AM, Tyler Hobbs <tyler@datastax.com> = wrote:
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 = 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 <aaron@thelastpickle.com> = wrote:
Yup, thats a pretty common pattern. = How exactly depends on the client you are = using. 


with column_start=3D"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 =3D "ABC_~" you would get everything = that starts with ABC_

Cheers

-----------------
Aaron Morton
Freelance = Cassandra Developer
@aaronmorton

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



= --Apple-Mail=_1D8473B6-9B9C-4B55-AB71-78D66B5BB061--