cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tyler Hobbs <>
Subject Re: Reading a keyrange when using RP
Date Thu, 21 Oct 2010 18:14:26 GMT
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çu <> wrote:

> 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çu <>wrote:
>>> 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, under
>>> RandomPartitioner)
>>> How can I utilize cassandra to get a keyrange in RP?
>>> Best Regards,
>>> Utku

View raw message