Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 42855 invoked from network); 2 Jun 2010 12:53:34 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 2 Jun 2010 12:53:34 -0000 Received: (qmail 64696 invoked by uid 500); 2 Jun 2010 12:53:33 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 64673 invoked by uid 500); 2 Jun 2010 12:53:33 -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 64665 invoked by uid 99); 2 Jun 2010 12:53:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jun 2010 12:53:33 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ben324@gmail.com designates 209.85.160.172 as permitted sender) Received: from [209.85.160.172] (HELO mail-gy0-f172.google.com) (209.85.160.172) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jun 2010 12:53:27 +0000 Received: by gyh4 with SMTP id 4so4669015gyh.31 for ; Wed, 02 Jun 2010 05:53:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=+jqYU+3+wemxaoO7yJdP8tF2vYus01XdrLFzfoKiIsk=; b=tY+dUC3b5FJeC5ezas2AulT/8ihL80C6DBQRE5bE0A3e+UTrzMIWVnO+tV1zIsIEK1 xonYKZhXjTRZpE5r89o0BPalvXNAJbOMKIeBntJ/fngU7TNJ/QLe2xBB8KwHZ4IKL85Z DuhEcD33Qa3l0xMg8Zlwj/Ul1y/Xka3g4pDh0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=xRnhmRDpEbSCgTaeACRGAQj92S7SlqYL5AnTx1sn6hti9mcNNV3SbnM7PGQxjWF6Ab a0D8I7yXZNw/sj8EsJCa2IU1wU/m87mIaG2frAGRyXcsavilkD6zOKP63i7jzSyID2c2 nQPFHX3TXTt74LyqBp5NPjl0UgIElNcBEG1Rc= MIME-Version: 1.0 Received: by 10.229.248.197 with SMTP id mh5mr1386026qcb.32.1275483186904; Wed, 02 Jun 2010 05:53:06 -0700 (PDT) Received: by 10.229.9.148 with HTTP; Wed, 2 Jun 2010 05:53:06 -0700 (PDT) In-Reply-To: <1OJnIA-0004R3-Ik@mail.eleven.de> References: <1OJmvq-0003eg-Sh@mail.eleven.de> <1OJnIA-0004R3-Ik@mail.eleven.de> Date: Wed, 2 Jun 2010 08:53:06 -0400 Message-ID: Subject: Re: Range search on keys not working? From: Ben Browning To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Martin, On Wed, Jun 2, 2010 at 8:34 AM, Dr. Martin Grabm=FCller wrote: > I think you can specify an end key, but it should be a key which does exi= st > in your column family. Logically, it doesn't make sense to ever specify an end key with random partitioner. If you specified a start key of "aaa" and and end key of "aac" you might get back as results "aaa", "zfc", "hik", etc. And, even if you have a key of "aab" it might not show up. Key ranges only make sense with order-preserving partitioner. The only time to ever use a key range with random partitioner is when you want to iterate over all keys in the CF. Ben > But maybe I'm off the track here and someone else here knows more about t= his > key range stuff. > > Martin > > ________________________________ > From: David Boxenhorn [mailto:david@lookin2.com] > Sent: Wednesday, June 02, 2010 2:30 PM > To: user@cassandra.apache.org > Subject: Re: Range search on keys not working? > > In other words, I should check the values as I iterate, and stop iteratin= g > when I get out of range? > > I'll try that! > > On Wed, Jun 2, 2010 at 3:15 PM, Dr. Martin Grabm=FCller > wrote: >> >> When not using OOP, you should not use something like 'CATEGORY/' as the >> end key. >> Use the empty string as the end key and limit the number of returned key= s, >> as you did with >> the 'max' value. >> >> If I understand correctly, the end key is used to generate an end token = by >> hashing it, and >> there is not the same correspondence between 'CATEGORY' and 'CATEGORY/' = as >> for >> hash('CATEGORY') and hash('CATEGORY/'). >> >> At least, this was the explanation I gave myself when I had the same >> problem. >> >> The solution is to iterate through the keys by always using the last key >> returned as the >> start key for the next call to get_range_slices, and the to drop the fir= st >> element from >> the result. >> >> HTH, >> =A0 Martin >> >> ________________________________ >> From: David Boxenhorn [mailto:david@lookin2.com] >> Sent: Wednesday, June 02, 2010 2:01 PM >> To: user@cassandra.apache.org >> Subject: Re: Range search on keys not working? >> >> The previous thread where we discussed this is called, "key is sorted?" >> >> >> On Wed, Jun 2, 2010 at 2:56 PM, David Boxenhorn wrot= e: >>> >>> I'm not using OPP. But I was assured on earlier threads (I asked severa= l >>> times to be sure) that it would work as stated below: the results would= not >>> be ordered, but they would be correct. >>> >>> On Wed, Jun 2, 2010 at 2:51 PM, Torsten Curdt wrote: >>>> >>>> Sounds like you are not using an order preserving partitioner? >>>> >>>> On Wed, Jun 2, 2010 at 13:48, David Boxenhorn wrot= e: >>>> > Range search on keys is not working for me. I was assured in earlier >>>> > threads >>>> > that range search would work, but the results would not be ordered. >>>> > >>>> > I'm trying to get all the rows that start with "CATEGORY." >>>> > >>>> > I'm doing: >>>> > >>>> > String start =3D "CATEGORY."; >>>> > . >>>> > . >>>> > . >>>> > keyspace.getSuperRangeSlice(columnParent, slicePredicate, start, >>>> > "CATEGORY/", max) >>>> > . >>>> > . >>>> > . >>>> > >>>> > in a loop, setting start to the last key each time - but I'm getting >>>> > rows >>>> > that don't start with "CATEGORY."!! >>>> > >>>> > How do I get all rows that start with "CATEGORY."? >>> >> > >