Select First N from Cassandra Column using CQL
Domanda
How to get First N columns of a given row key in Cassandra?
cqlsh> select FIRST 5 from Daily_Domain_Stats where KEY = '20111110:1';
Bad Request: line 1:15 no viable alternative at input 'from'
cqlsh> select 'FIRST' 5 from Daily_Domain_Stats where KEY = '20111110:1';
Bad Request: line 1:15 no viable alternative at input '5'
cqlsh> select 'FIRST 5' from Daily_Domain_Stats where KEY = '20111110:1';
cqlsh> select FIRST '5' from Daily_Domain_Stats where KEY = '20111110:1';
Internal application error
cqlsh> select 5 from Daily_Domain_Stats where KEY = '20111110:1';
cqlsh> select [FIRST 5] from Daily_Domain_Stats where KEY = '20111110:1';
Bad Request: line 1:15 no viable alternative at character ']'
I tried all these ways but nothing gave me the proper result. Im using cql 1.0.5 Python client
Help Regards, Tamil
Soluzione
Found the solution,
cqlsh> select first 5 '0'..'9' from Daily_Customer_Stats;
This worked
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow