Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 73317 invoked from network); 27 Dec 2010 16:35:51 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 27 Dec 2010 16:35:51 -0000 Received: (qmail 56097 invoked by uid 500); 27 Dec 2010 16:35:49 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 55973 invoked by uid 500); 27 Dec 2010 16:35:46 -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 55965 invoked by uid 99); 27 Dec 2010 16:35:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Dec 2010 16:35:46 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of roshandawrani@gmail.com designates 74.125.82.44 as permitted sender) Received: from [74.125.82.44] (HELO mail-ww0-f44.google.com) (74.125.82.44) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Dec 2010 16:35:39 +0000 Received: by wwa36 with SMTP id 36so9427819wwa.25 for ; Mon, 27 Dec 2010 08:35:19 -0800 (PST) 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; bh=1etHqd9edkwcxY4Q2AQToOCBbilX2uS11GeN+J/lvZY=; b=EbmauQOTMFp6dp76Nllbbc8QnCtYZK5aqv42ZEKYezowMMkv4A09tOc1jkHpx1NsZZ NpiwTJ9XtWBvc0nPJfFS9jmpgfVgJbAEJ9DSQII2cm/taxDuYy3Mw72SdnjdiQHBIk8b LqFTKB10MrORxa7E5SNkkNUtdEML+tdbYwOag= 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; b=TBoWLeVfc6zQdaZ94EgaU7ph3ucQlaE2C2mh5IcpZshDSl3omy+R3oWj/FIq9qzhWl s+Ns98cX3FlIDtn7HGGMM5j4zs9xpzz1MGPDAOgY+K1cFi5bxhbSJm4rYj1bJBEhs69S wPLEOKl+uWWcDw+kEr46KjtVp4Pp7XyJ18D0c= MIME-Version: 1.0 Received: by 10.216.13.194 with SMTP id b44mr13051599web.68.1293467719591; Mon, 27 Dec 2010 08:35:19 -0800 (PST) Received: by 10.216.13.5 with HTTP; Mon, 27 Dec 2010 08:35:19 -0800 (PST) In-Reply-To: References: Date: Mon, 27 Dec 2010 22:05:19 +0530 Message-ID: Subject: Re: I have TimeUUID sorted keys. Can I get the range query return rows in the same order as sorted keys? From: Roshan Dawrani To: user@cassandra.apache.org, hector-users@googlegroups.com Content-Type: multipart/alternative; boundary=0016e64c1bbef467cc049866eb55 X-Virus-Checked: Checked by ClamAV on apache.org --0016e64c1bbef467cc049866eb55 Content-Type: text/plain; charset=ISO-8859-1 I had seen RangeSlicesQuery, but I didn't notice that I could also give a key range there. How does a KeyRange work? Doesn't it need some sort from the partitioner - whether that is order preserving or not? I couldn't be sure of a query that was based on order of the rows in the column family, so I didn't explore that much. On Mon, Dec 27, 2010 at 9:55 PM, Narendra Sharma wrote: > Did you look at get_range_slices? Once you get the columns from super > column, pick the first and last to form the range and fire the > get_range_slice. > > Thanks, > -Naren > > > On Mon, Dec 27, 2010 at 6:12 AM, Roshan Dawrani wrote: > >> This silly question is retrieved back with apology. There couldn't be >> anything easier to handle at the application level. >> >> rgds, >> Roshan >> >> >> On Mon, Dec 27, 2010 at 9:04 AM, Roshan Dawrani wrote: >> >>> Hi, >>> I have the following 2 column families - one being used to store full >>> rows for an entity and other is an index table for having the TimeUUID >>> sorted row keys. >>> >>> I am able to query the TimeUUID columns under the super column fine. But >>> now I need to go to main CF and get the data and I want the rows in the same >>> time order as the keys. >>> >>> I am using MultiGetSliceQuery to query the main entity data for the >>> sorted keys, but the rows don't come back in the same order, which defeats >>> the purpose of storing the time sorted subcolumns. I suppose for each key, I >>> can fire an individual SliceQuery, but that does not look efficient to me. I >>> do want to fire a range query. >>> >>> MainEntityCF { >>> TimeUUIDKeyA: ["Col1" : "Val1", "Col2" : "Val2", "Col3" : >>> "Val3"] >>> TimeUUIDKeyX: ["Col1" : "Val1", "Col2" : "Val2", "Col3" : >>> "Val3"] >>> TimeUUIDKeyB: ["Col1" : "Val1", "Col2" : "Val2", "Col3" : >>> "Val3"] >>> TimeUUIDKeyY: ["Col1" : "Val1", "Col2" : "Val2", "Col3" : >>> "Val3"] >>> } >>> MainEntityCF_Index { >>> "SomeSuperColumn": [TimeUUIDKeyA:null, TimeUUIDKeyB:null, >>> TimeUUIDKeyX:null, TimeUUIDKeyY:null] >>> } >>> >>> -- >>> Roshan >>> Blog: http://roshandawrani.wordpress.com/ >>> Twitter: @roshandawrani >>> Skype: roshandawrani >>> >>> > -- Roshan Blog: http://roshandawrani.wordpress.com/ Twitter: @roshandawrani Skype: roshandawrani --0016e64c1bbef467cc049866eb55 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I had seen RangeSlicesQuery, but I didn't notice that I could also give= a key range there.

How does a KeyRange work? Doesn't it need so= me sort from the partitioner - whether that is order preserving or not?
I couldn't be sure of a query that was based on order of the rows i= n the column family, so I didn't explore that much.


On Mon, Dec 27, 2010 at 9:55 PM, Narendra Sharma <narendra.sharma= @gmail.com> wrote:
Did you look at <= tt>get_range_slices? Once you get the columns from super column, pick the f= irst and last to form the range and fire the get_range_slice.

Thanks,
-Naren


On Mon, Dec 27, 2010 at 6:12 AM, Roshan Dawrani <roshandawrani@gmail= .com> wrote:
This silly question is retrieved back with apology. There couldn't be a= nything easier to handle at the application level.

rgds,
Roshan


On Mon, Dec 27, 2010 at 9:04 AM, Roshan Dawrani <roshandawrani@gmail= .com> wrote:
Hi,
I have the= following 2 column families - one being used to store full rows for an ent= ity and other is an index table for having the TimeUUID sorted row keys.
I am able to query the TimeUUID columns under the super column fine. Bu= t now I need to go to main CF and get the data and I want the rows in the s= ame time order as the keys.

I am using MultiGetSliceQuery to query the main entity data for the sor= ted keys, but the rows don't come back in the same order, which defeats= the purpose of storing the time sorted subcolumns. I suppose for each key,= I can fire an individual SliceQuery, but that does not look efficient to m= e. I do want to fire a range query.

MainEntityCF {
=A0=A0=A0=A0=A0=A0=A0=A0 TimeUUIDKeyA: ["Col1&qu= ot; : "Val1", "Col2" : "Val2", "Col3&quo= t; : "Val3"]
=A0=A0=A0=A0=A0=A0=A0=A0 TimeUUIDKeyX: ["Col= 1" : "Val1", "Col2" : "Val2", "Col3= " : "Val3"]
=A0=A0=A0=A0=A0=A0=A0=A0 TimeUUIDKeyB: ["Col1" : "Val1"= , "Col2" : "Val2", "Col3" : "Val3"]=
=A0=A0=A0=A0=A0=A0=A0=A0 TimeUUIDKeyY: ["Col1" : "Val1&q= uot;, "Col2" : "Val2", "Col3" : "Val3&qu= ot;]
}
MainEntityCF_Index {
=A0=A0=A0=A0=A0 "SomeSuperColumn": [= TimeUUIDKeyA:null, TimeUUIDKeyB:null, TimeUUIDKeyX:null, TimeUUIDKeyY:null]=
}

--
Roshan
Blog: <= a href=3D"http://roshandawrani.wordpress.com/" target=3D"_blank">http://ros= handawrani.wordpress.com/
Twitter: @ro= shandawrani
Skype: roshandawrani





--
Roshan
B= log: http= ://roshandawrani.wordpress.com/
Twitter: @roshandawrani
Skype: roshandawrani

--0016e64c1bbef467cc049866eb55--