incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roshan Dawrani <roshandawr...@gmail.com>
Subject Re: I have TimeUUID sorted keys. Can I get the range query return rows in the same order as sorted keys?
Date Mon, 27 Dec 2010 16:35:19 GMT
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 <http://twitter.com/roshandawrani>
>>> Skype: roshandawrani
>>>
>>>
>


-- 
Roshan
Blog: http://roshandawrani.wordpress.com/
Twitter: @roshandawrani <http://twitter.com/roshandawrani>
Skype: roshandawrani

Mime
View raw message