incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Chang <pete...@gmail.com>
Subject Re: get ordered by value
Date Tue, 23 Mar 2010 16:27:51 GMT
Perhaps an inverted index would work.

supercolumn=5 subcolumn=1036
supercolumn=3 subcolumn=13838

I only used a super column family so that you could have multiple subcolumns
for the same supercolumn.

Peter

2010/3/22 Juan Manuel GarcĂ­a del Moral <juanmanuel@taringa.net>

> Hello
>
> I have this:
>
> get SocialAds.Anonimos['3539792'];
> => (super_column=Tag,
>      (column=1036, value=5, timestamp=1001181414)
>      (column=116, value=2, timestamp=1001181414)
>      (column=121988, value=2, timestamp=1001181413)
>      (column=13838, value=3, timestamp=1001181416)
>      (column=14105, value=2, timestamp=1001181413)
>      (column=169095, value=2, timestamp=1001181414)
>      (column=30253, value=2, timestamp=1001181413)
>      (column=350737, value=1, timestamp=1001181341)
>      (column=350738, value=1, timestamp=1001181341))
>
> I would need to get the column with the highest value for that CF, this is
> something I have to do in the get() or in the data schema?
>
> my schema is:
>
> <Keyspace Name="SocialAds">
>
> <ColumnFamily ColumnType="Super"
>                     CompareWith="UTF8Type"
>                     CompareSubcolumnsWith="UTF8Type"
>                     Name="Anonimos"
>                     RowsCached="1000"
>                     KeysCached="50%"
>                     Comment="A column family with supercolumns, whose
> column and subcolumn names are UTF8 strings"/>
>
>
> <ReplicaPlacementStrategy>org.apache.cassandra.locator.RackUnawareStrategy</ReplicaPlacementStrategy>
>       <ReplicationFactor>1</ReplicationFactor>
>
> <EndPointSnitch>org.apache.cassandra.locator.EndPointSnitch</EndPointSnitch>
> </Keyspace>
>
>
> Any ideas?
>
> Thanks in advance
>
> Juan
>
>

Mime
View raw message