cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark <static.void....@gmail.com>
Subject Re: Index/Count/Order by syntax
Date Thu, 29 Jul 2010 22:04:01 GMT
Ok so basically an "array" of words grouped by their count?

Something like this?

{
    SearchLogs : {
       ALL : {
            999: { word1:word1, word2:word2, word3:word3 }
            998: { word1:word1, word2:word2, word3:word3 }
       }
    }
}

On 7/29/10 2:50 PM, Aaron Morton wrote:
> One method would be to use a Super Column Family. Have one row, in 
> that create a column family for each count value you have, and then in 
> the super column create a column for each word.
>
> Set the CompareWith for the super col to be LongType and the 
> CompareSubcolumnsWith to be AsciiTyoe or UTFType.
>
> You could then use get_slice to read super columns in that row.
>
> This may not be the most efficient model, it will depend how how much 
> data you have and what your read patterns are like. Also be remember 
> that pre 0.7 you cannot atomically increment counters in cassandra.
>
> Have a play and see what works for you.
>
> Aaron
>
> On 29 Jul, 2010,at 02:36 PM, Mark <static.void.dev@gmail.com> wrote:
>
>> I know there is no native support for "order by", "group by" etc but I
>> was wondering how it could be accomplished with some custom indexes?
>>
>> For example, say I have a list of word counts like (notice 2 words have
>> the same count):
>>
>> "cassandra" => 100
>> "foo" => 999
>> "bar" => 1
>> "baz" => 500
>> "fooz" => 999
>>
>> How can I store then retrieve these words ordered by their count/values?
>>
>> Thanks.


Mime
View raw message