如何在Cassandra中获取给定行键的前N列?
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 ']'
我尝试了所有这些方法,但没有给我正确的结果。我使用的是cql 1.0.5 Python客户端
帮助 此致,泰米尔语
答案 0 :(得分:4)
找到解决方案,
cqlsh> select first 5 '0'..'9' from Daily_Customer_Stats;
这有效