Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 95475 invoked from network); 27 Dec 2010 17:51:55 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 27 Dec 2010 17:51:55 -0000 Received: (qmail 22339 invoked by uid 500); 27 Dec 2010 17:51:53 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 22248 invoked by uid 500); 27 Dec 2010 17:51:53 -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 22240 invoked by uid 99); 27 Dec 2010 17:51:53 -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 17:51:53 +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.172 as permitted sender) Received: from [74.125.82.172] (HELO mail-wy0-f172.google.com) (74.125.82.172) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Dec 2010 17:51:47 +0000 Received: by wyf23 with SMTP id 23so8915179wyf.31 for ; Mon, 27 Dec 2010 09:51:24 -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=+Kg8Ve03uam0SKHH+DbE1hbcPHVNVeZguUzqUBHREqU=; b=tZSCXDdRSNbSDK1M/EeaiXEX/bcHGOoyuyPcYmWjaweBSIBM+9sfkigqarXIqm+NeQ cjUeeXHauLjT42k5V58jPk5oDn0VJZket9MrSoyOe1cCfFt4WRmaY5zh8StO9S6DbXGm hErZ1dct1+ps8Xjo3zWioI6XBxlDDPkN5kmFM= 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=Pi+JgA+Y2ZZ2uUjgr7uFLVGpldduPc9JL5snMoVIP9SMQwBXFPw8UmV9hWWvo1NA8x Dp5RPLMVq/TPj8IdBARnoGbuiPNu/MWqb5CFkAn/lSO3yGRIxVD6c/s6kYexkgCUkkwK hxDUYzqoNWS+zUcuAXNuFKRAeQsv7bKOSnrLc= MIME-Version: 1.0 Received: by 10.216.150.129 with SMTP id z1mr3412274wej.113.1293472284251; Mon, 27 Dec 2010 09:51:24 -0800 (PST) Received: by 10.216.13.5 with HTTP; Mon, 27 Dec 2010 09:51:24 -0800 (PST) In-Reply-To: References: Date: Mon, 27 Dec 2010 23:21:24 +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 Content-Type: multipart/alternative; boundary=0016e6de014e079529049867fcd3 X-Virus-Checked: Checked by ClamAV on apache.org --0016e6de014e079529049867fcd3 Content-Type: text/plain; charset=ISO-8859-1 Thanks for the references. I will have a look at them to become familiar with them. But for now, my rather simplistic need is fulfilled by first getting the time-sorted keys from sub-columns and then arranging the result of a multi_get_slice_query in the same order at the app level. For now I don't want to get into OPP to achieve it - as I see some "be careful" annotations with it. Nice and simple to start in Cassandra field. :-) Thanks again for the information though. On Mon, Dec 27, 2010 at 11:15 PM, Tyler Hobbs wrote: > Might as well link to this nice article for any discussions of OPP vs RP: > > > http://ria101.wordpress.com/2010/02/22/cassandra-randompartitioner-vs-orderpreservingpartitioner/ > > - Tyler > > > On Mon, Dec 27, 2010 at 11:18 AM, Narendra Sharma < > narendra.sharma@gmail.com> wrote: > >> You will need to use OPP to perform range scans. Look for Range Queries on >> http://wiki.apache.org/cassandra/DataModel >> >> Look at this to understand why range queries are not supported for >> RamdomPartitioner (https://issues.apache.org/jira/browse/CASSANDRA-1750) >> >> Thanks, >> Naren >> >> >> On Mon, Dec 27, 2010 at 8:35 AM, Roshan Dawrani wrote: >> >>> 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 < >>> narendra.sharma@gmail.com> 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 < >>>> roshandawrani@gmail.com> 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 < >>>>> roshandawrani@gmail.com> 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 >>> >>> >> > -- Roshan Blog: http://roshandawrani.wordpress.com/ Twitter: @roshandawrani Skype: roshandawrani --0016e6de014e079529049867fcd3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks for the references. I will have a look at them to become familiar wi= th them.

But for now, my rather simplistic need is fulfilled by firs= t getting the time-sorted keys from sub-columns and then arranging the resu= lt of a multi_get_slice_query in the same order at the app level.

For now I don't want to get into OPP to achieve it - as I see some = "be careful" annotations with it. Nice and simple to start in Cas= sandra field. :-) Thanks again for the information though.


On Mon, Dec 27, 2010 at 11:15 PM, Tyler Hobbs <tyler@riptano.com> wrote:
Might as well link to this nice article for any discussions of OPP vs RP:
http://ria101.wo= rdpress.com/2010/02/22/cassandra-randompartitioner-vs-orderpreservingpartit= ioner/

- Tyler


On Mon, Dec 27, 2010 at 11:18 AM, Narendra Sharma <nar= endra.sharma@gmail.com> wrote:
You will need to use OPP to perform range scans. Look for Range Queries on = ht= tp://wiki.apache.org/cassandra/DataModel

Look at this to underst= and why range queries are not supported for RamdomPartitioner (http= s://issues.apache.org/jira/browse/CASSANDRA-1750)

Thanks,
Naren


On Mon, Dec 27, 2010 at 8:35 AM, Roshan Dawrani <roshandawrani@gmai= l.com> wrote:
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, Na= rendra 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






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

--0016e6de014e079529049867fcd3--