You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Poonam Ligade <po...@gmail.com> on 2015/01/21 15:16:14 UTC

Count of column values

Hi,

I am newbie to Cassandra.
I have to find out top 10 recent trends in data

I have schema as follows

create table trends(
day int,
data1 text,
data2 map<int, decimal>,
PRIMARY KEY (day, data1)) ;

I have to take count of duplicate values in data1 so that i can find top 10
data1 trends.

1. I tried adding an counter column, but again you can't use order by
clause on counter column.
2. I tried using where clause

Re: Count of column values

Posted by Poonam Ligade <po...@gmail.com>.
Hi ,

Sorry for the previous incomplete message.
I am using where clause as follows:
select count(*) from trends where data1='abc' ALLOW FILTERING;
How can i store this count output to any other column.

Can you help with any wayround.

Thanks,
Poonam.

On Wed, Jan 21, 2015 at 7:46 PM, Poonam Ligade <po...@gmail.com>
wrote:

> Hi,
>
> I am newbie to Cassandra.
> I have to find out top 10 recent trends in data
>
> I have schema as follows
>
> create table trends(
> day int,
> data1 text,
> data2 map<int, decimal>,
> PRIMARY KEY (day, data1)) ;
>
> I have to take count of duplicate values in data1 so that i can find top
> 10 data1 trends.
>
> 1. I tried adding an counter column, but again you can't use order by
> clause on counter column.
> 2. I tried using where clause
>