From user-return-31599-apmail-cassandra-user-archive=cassandra.apache.org@cassandra.apache.org Sat Feb 2 07:07:22 2013 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 10E66E6BA for ; Sat, 2 Feb 2013 07:07:22 +0000 (UTC) Received: (qmail 61678 invoked by uid 500); 2 Feb 2013 07:07:19 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 61646 invoked by uid 500); 2 Feb 2013 07:07: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 61630 invoked by uid 99); 2 Feb 2013 07:07:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Feb 2013 07:07:18 +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-a79.g.dreamhost.com) (208.113.200.5) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Feb 2013 07:07:11 +0000 Received: from homiemail-a79.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a79.g.dreamhost.com (Postfix) with ESMTP id B379D7D406E for ; Fri, 1 Feb 2013 23:06:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=thelastpickle.com; h=from :content-type:message-id:mime-version:subject:date:references:to :in-reply-to; s=thelastpickle.com; bh=av5w6tDPuGg14qVMDGdWLSL4vm c=; b=EUh8lDBEjU724MUzClzT/DHLaEtv9XCHeCEkcPRKdMFmLIXLoDAmJoR3su r77iHYuPetwOleepmtrWPDtmbR0QdRl9AK1IdV86W9w3c5JO0lKBt5scWudjjqec pt9dF0lHoeXWq3b+aIcugR2MQRnrZFntk8PgWBKrQuoqjwMLc= Received: from [172.16.1.8] (unknown [203.86.207.101]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: aaron@thelastpickle.com) by homiemail-a79.g.dreamhost.com (Postfix) with ESMTPSA id BC8C07D4059 for ; Fri, 1 Feb 2013 23:06:30 -0800 (PST) From: aaron morton Content-Type: multipart/alternative; boundary="Apple-Mail=_B6BBE6BE-3B9F-4723-A685-9FF4DBBE1C1E" Message-Id: <10467F68-338F-4B9F-8ED6-3F5FA0C9B0CF@thelastpickle.com> Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: rangeQuery to traverse keys backward? Date: Sat, 2 Feb 2013 20:06:43 +1300 References: To: user@cassandra.apache.org In-Reply-To: X-Mailer: Apple Mail (2.1499) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_B6BBE6BE-3B9F-4723-A685-9FF4DBBE1C1E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 There is no facility to do a get_range in reverse.=20 Rows are ordered by their token, and using the Random or Murmur3 = partitioner this means they are randomly ordered. So there is not much = need to go backwards, or get 10 rows from either side of a particular = row.=20 Can you change your data model to not require precise range scans ?=20 Cheers ----------------- Aaron Morton Freelance Cassandra Developer New Zealand @aaronmorton http://www.thelastpickle.com On 1/02/2013, at 1:36 PM, Yuhan Zhang wrote: > Hi all, >=20 > I'm tryinng to use get_range to traverse the rows by page by providing = a :start_key and an :finish_key. >=20 > This works fine when I traverse forward with :start_key=3D>last_key, = :finish_key=3D>"" > However, when I tried to traversed backward with :start_key=3D"", = :finish_key=3D>first_key, this always gave me the first few rows in the = column family. > (my goal is to get the rows adjacent to my "first_key") >=20 > looks like it always takes priority of :start_key over the = :finish_key. >=20 > as for column range, there is an option to reverse the order. but = there is an option for traversing rows. > so I'm wondering whether cassandra is capable of doing this task with = the current api >=20 > I tried both twitter cassandra client and hector client, but couldn't = find a way to perform it. > have someone been able to do this? >=20 >=20 > Thank you >=20 > Yuhan=20 > The information contained in this e-mail is for the exclusive use of = the intended recipient(s) and may be confidential, proprietary, and/or = legally privileged. Inadvertent disclosure of this message does not = constitute a waiver of any privilege. If you receive this message in = error, please do not directly or indirectly print, copy, retransmit, = disseminate, or otherwise use the information. In addition, please = delete this e-mail and all copies and notify the sender. --Apple-Mail=_B6BBE6BE-3B9F-4723-A685-9FF4DBBE1C1E Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=iso-8859-1 There = is no facility to do a get_range in = reverse. 

Rows are ordered by their token, and = using the Random or Murmur3 partitioner this means they are randomly = ordered. So there is not much need to go backwards, or get 10 rows from = either side of a particular row. 

Can you = change your data model to not require precise range scans = ? 

Cheers

http://www.thelastpickle.com

On 1/02/2013, at 1:36 PM, Yuhan Zhang <yzhang@onescreen.com> = wrote:

Hi all,

I'm tryinng to use get_range to traverse = the rows by page by providing a :start_key and an = :finish_key.

This works fine when I traverse forward with = :start_key=3D>last_key, :finish_key=3D>""
However, when I tried to traversed backward with :start_key=3D"", = :finish_key=3D>first_key, this always gave me the first few rows in = the column family.
(my goal is to get  the rows adjacent to my = "first_key")

looks like it always takes priority of :start_key over the = :finish_key.

as for column range,  there is an option to = reverse the order. but there is an option for  traversing = rows.
so I'm wondering whether cassandra is capable of doing this = task with the current api

I tried both twitter cassandra client and hector client, but = couldn't find a way to perform it.
have someone been able to do = this?


Thank you

Yuhan
The information contained in this e-mail is for the = exclusive use of the intended recipient(s) and may be confidential, = proprietary, and/or legally privileged. Inadvertent disclosure of this = message does not constitute a waiver of any privilege.  If you = receive this message in error, please do not directly or indirectly = print, copy, retransmit, disseminate, or otherwise use the information. = In addition, please delete this e-mail and all copies and notify the = sender.

= --Apple-Mail=_B6BBE6BE-3B9F-4723-A685-9FF4DBBE1C1E--