cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Ellis <jbel...@gmail.com>
Subject Re: Possible to do sort...limit on Cassandra?
Date Mon, 18 Jan 2010 15:18:34 GMT
that would correspond to the CompareWith I mentioned

On Sun, Jan 17, 2010 at 11:19 PM, Alex Dong <alex.dong@binaryplex.com> wrote:
> Thanks Jonathan,
>
>> two, if you use OrderPreservingPartitioner (whcih lets you specify key
>> sort order)
>
> I guess this is still a rather static approach, right?
> That is, if I use a specified OrderPreservingPartitioner, I will be locked
> into the physical data layout specified here.
> Or, am I missing anything?
>
> According to the BigTable paper, the 'rows' are ordered by PK but you still
> have the flexibility to create index on 'Column' or 'ColumnFamily'.  Do we
> have similar mechanism in Cassandra?
>
> Thanks,
> Alex
>
> On 2010-1-18, at 下午3:28, Jonathan Ellis wrote:
>
>> you get one "sort" for free, which is the column sort you specify with
>> CompareWith
>>
>> two, if you use OrderPreservingPartitioner (whcih lets you specify key
>> sort order)
>>
>> On Sun, Jan 17, 2010 at 5:18 PM, Alex Dong <alex.dong@binaryplex.com>
>> wrote:
>>>
>>> Hi folks,
>>>
>>> I'm new to Cassandra.  I'm evaluating Cassandra, HBase and Voldemort to
>>> see
>>> which one matches our app model better. Here is a typical data model:
>>>
>>> stats {
>>>       word_id: {
>>>               user_id: {
>>>                       total_hits: 193,
>>>                       monthly_hits: [2, 31, 21, 10, 10, 7, 8, 0, 0,
0, 1,
>>> 2]
>>>               },
>>>               ..
>>>       }
>>>       ...
>>> }
>>>
>>> I'm sure that I can pull all the data out from Cassandra and use
>>> mapreduce
>>> to sort or merge.   But I'm wondering are there any way in cassandra to
>>> 'automate' this process:
>>> 1) for a given 'word_id', get a list of user_id: { }  sorted by
>>> 'total_hits'?
>>> 2) for two 'word_id's, get an 'intersect' result of the user: {} list
>>> sorted
>>> by the combined 'total_hits'?
>>>
>>> Cheers,
>>> Alex
>>>
>
> -----------------------------------------------------
> Alex Dong
> Co-Founder BinaryPlex
> http://binaryplex.com/
> twitter: @alexdong
>
>

Mime
View raw message