cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Morton <>
Subject Re: Index/Count/Order by syntax
Date Thu, 29 Jul 2010 21:50:42 GMT
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.


On 29 Jul, 2010,at 02:36 PM, Mark <> 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.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
    • Unnamed multipart/related (inline, None, 0 bytes)
View raw message