How to select few records from each match in one query in Cassandra?

100 Views Asked by At

I have a Cassandra table testtable with primary key (partitionkey, cl1, cl2). Now I need to query data for partition p1 where cl1 in (a1, a2, a3, a4, a5, a6, a7).

select * from testtable where partitionkey=p1 and cl1 
   in (a1, a2, a3, a4, a5, a6, a7) limit 10000;

Is there any way to specify that the query returns a maximum of 100 records matching each cl1, i.e. maximum 100 records which match a1, maximum 100 records which match a2 etc. I don't want to fire multiple queries for that.

0

There are 0 best solutions below