我有一个使用创建的表CQL3
:
create table compositetest(m_id ascii,i_id int,l_id ascii,body ascii,
PRIMARY KEY(m_id,i_id,l_id));
插入一些随机数据:
cqlsh:testkeyspace1> insert into compositetest(m_id,i_id,l_id,body) VALUES ('m1',1,'l1','b1');
cqlsh:testkeyspace1> insert into compositetest(m_id,i_id,l_id,body) VALUES ('m2',2,'l2','b2');
cqlsh:testkeyspace1> insert into compositetest(m_id,i_id,l_id,body) VALUES ('m1',2,'l2','b2');
cqlsh:testkeyspace1> insert into compositetest(m_id,i_id,l_id,body) VALUES ('m2',1,'l1','b1');
cqlsh:testkeyspace1> insert into compositetest(m_id,i_id,l_id,body) VALUES ('m3',3,'l1','b1');
cqlsh:testkeyspace1> insert into compositetest(m_id,i_id,l_id,body) VALUES ('m3',2,'l2','b2');
cqlsh:testkeyspace1> insert into compositetest(m_id,i_id,l_id,body) VALUES ('m3',1,'l2','b2');
cqlsh:testkeyspace1> select * from compositetest;
m_id | i_id | l_id | body
------+------+------+------
m1 | 1 | l1 | b1
m1 | 2 | l2 | b2
m2 | 1 | l1 | b1
m2 | 2 | l2 | b2
m3 | 1 | l2 | b2
m3 | 2 | l2 | b2
m3 | 3 | l1 | b1
当我进行查询时
cqlsh:testkeyspace1> select * from compositetest where i_id<=3 limit 3;
m_id | i_id | l_id | body
------+------+------+------
m1 | 1 | l1 | b1
m1 | 2 | l2 | b2
m2 | 1 | l1 | b1
现在,如果我想获得接下来的 3 行
cqlsh:testkeyspace1> ?
正在尝试为切片范围编写 CQL(不确定是否可以完成)
我的 CQLSh 显示 Socket 已关闭,我看到了错误
TSocket read 0 bytes
在服务器端,我看到以下错误:
ERROR [Thrift:3] 2012-08-12 15:15:24,414 CustomTThreadPoolServer.java (line 204) Error occurred during processing of message.
java.lang.NullPointerException
at org.apache.cassandra.cql3.statements.SelectStatement$Restriction.setBound(SelectStatement.java:1277)
at org.apache.cassandra.cql3.statements.SelectStatement$RawStatement.updateRestriction(SelectStatement.java:1151)
at org.apache.cassandra.cql3.statements.SelectStatement$RawStatement.prepare(SelectStatement.java:1001)
at org.apache.cassandra.cql3.QueryProcessor.getStatement(QueryProcessor.java:215)
at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:121)
at org.apache.cassandra.thrift.CassandraServer.execute_cql_query(CassandraServer.java:1237)
at org.apache.cassandra.thrift.Cassandra$Processor$execute_cql_query.getResult(Cassandra.java:3542)
at org.apache.cassandra.thrift.Cassandra$Processor$execute_cql_query.getResult(Cassandra.java:3530)
at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:32)
at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:34)
at org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:186)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
我如何获得接下来的 3 行,关于服务器端的异常,我将提交一个错误。CQLSh 已关闭,我现在必须退出并重新连接