cassandra - Limiting columns per record in CQL -


i've problem has been bothering me quite while now. i'm scaling down simplification.

i've column family in cassandra defined as:

  create table "test" (   key text,                            column1 text,                       value text,                           primary key (key, column1)        ) 

if run query in cql as:

select * "test" key in ('12345','34567'); 

it gives me like:

  key  | column1 | value -----------------------+---  12345 |     764 |    764  12345 |     836 |    836  12345 |  123723 | 123723  12345 |  155863 | 155863    key  | column1 | value -----------------------+---  34567 |  159144 | 159144  34567 |  159869 | 159869  34567 |  160705 | 160705 

now question how can limit results 2 rows max per record. tried use following didn't work.

select first 10 'a'..'z' "test" key in ('12345','34567');  

- not available in latest cql version.

select * "test" key in ('12345','34567') limit 2; 

-only limits total number of rows, not per record

there no way have type of limit in cql3. have run separate query each partition.

if query latency not issue you, can install sparksql/hive on top of cassandra database complex analytical queries 1 in original question. can cache result of these queries.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -