Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 10453 invoked from network); 21 Oct 2010 18:14:56 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 21 Oct 2010 18:14:56 -0000 Received: (qmail 23368 invoked by uid 500); 21 Oct 2010 18:14:55 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 23254 invoked by uid 500); 21 Oct 2010 18:14:55 -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 23246 invoked by uid 99); 21 Oct 2010 18:14:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Oct 2010 18:14:55 +0000 X-ASF-Spam-Status: No, hits=2.9 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.216.172] (HELO mail-qy0-f172.google.com) (209.85.216.172) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Oct 2010 18:14:49 +0000 Received: by qyk1 with SMTP id 1so974050qyk.10 for ; Thu, 21 Oct 2010 11:14:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.165.7 with SMTP id s7mr1990067muo.51.1287684867010; Thu, 21 Oct 2010 11:14:27 -0700 (PDT) Received: by 10.102.193.23 with HTTP; Thu, 21 Oct 2010 11:14:26 -0700 (PDT) X-Originating-IP: [64.132.24.248] In-Reply-To: References: Date: Thu, 21 Oct 2010 13:14:26 -0500 Message-ID: Subject: Re: Reading a keyrange when using RP From: Tyler Hobbs To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=00163662e5e814c1c40493247fb6 --00163662e5e814c1c40493247fb6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable It's possible with a second row/column family. In another Column Family, create a row where all of the column names are the row keys you want to be able to get a range of. Pick the comparator type for the column family so that the columns will be sorted in the order you want. You then get a slice of that row, take the column names you get back, and multiget those as rows in the original column family. The multiget results are unordered, but it's easy to order them in linear time. - Tyler On Thu, Oct 21, 2010 at 12:55 PM, Utku Can Top=E7u wrot= e: > The goal is actually getting the rows in the range of "start","end" > > The order is not important at all. > > But what I can see is, this does not seem to be possible at all using RP. > Am I wrong? > > > On Thu, Oct 21, 2010 at 6:03 PM, Tyler Hobbs wrote: > >> You can't get rows back in order with RP. >> >> You can start out with a start key and end key of '' (empty) and use the >> row count argument instead, if >> your goal is paging the rows. To get the next page, start from the last >> key you got in the >> previous page. >> >> >> On Thu, Oct 21, 2010 at 8:44 AM, Utku Can Top=E7u wro= te: >> >>> If I'm not mistaken cassandra has been providing support for keyrange >>> queries also on RP. >>> >>> However when I try to define a keyrange such as, start: (key100, end: >>> key200) I get an error like: >>> InvalidRequestException(why:start key's md5 sorts after end key's md5. >>> this is not allowed; you probably should not specify end key at all, un= der >>> RandomPartitioner) >>> >>> How can I utilize cassandra to get a keyrange in RP? >>> >>> Best Regards, >>> Utku >>> >> >> > --00163662e5e814c1c40493247fb6 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable It's possible with a second row/column family.

In another Column= Family, create a row where all of the column names are
the row keys you= want to be able to get a range of.=A0 Pick the comparator
type for the = column family so that the columns will be sorted in the order
you want.

You then get a slice of that row, take the column names yo= u get back,
and multiget those as rows in the original column family.=A0= The multiget
results are unordered, but it's easy to order them in = linear time.

- Tyler

On Thu, Oct 21, 2010 at 12:55= PM, Utku Can Top=E7u <utku@topcu.gen.tr> wrote:
The goal is actually getting the rows in the range of "start",&qu= ot;end"

The order is not important at all.

But what I ca= n see is, this does not seem to be possible at all using RP. Am I wrong?


On Thu, Oct 21, 2010 at 6:03 PM, Tyler Hobbs= <tyler@riptano.com> wrote:
You can't get rows back in order with RP.

You can start out with= a start key and end key of '' (empty) and use the row count argume= nt instead, if
your goal is paging the rows.=A0 To get the next page, st= art from the last key you got in the
previous page.


On Th= u, Oct 21, 2010 at 8:44 AM, Utku Can Top=E7u <utku@topcu.gen.tr> wrote:
If I'm not mistaken cassandra has been providing support for keyrange q= ueries also on RP.

However when I try to define a keyrange such as, = start: (key100, end: key200) I get an error like:
InvalidRequestExcepti= on(why:start key's md5 sorts after end key's md5.=A0 this is not al= lowed; you probably should not specify end key at all, under RandomPartitio= ner)

How can I utilize cassandra to get a keyrange in RP?

Best Regard= s,
Utku



--00163662e5e814c1c40493247fb6--