赫克托:赫克托核心1.0-5 Cassandra-1.1.2
我需要在 Hector 中建模一个查询,例如:
select * from table1 where rowkey='x' and secondary_indexed_column='y'
如果我使用将 setStartKey 设置为 rowKey 'x' 的 IndexedSliceQuery,我仍然会得到所有包含 secondary_indexed_column='y' 的行。如果我在 addEqualsExpression("row_key",'x') 中添加 row_key 字段,则会出现以下异常:
org.apache.thrift.protocol.TProtocolException: Required field 'value' was not present! Struct: IndexExpression(column_name:64 65 76 69 63 65 5F 69 64, op:EQ, value:null)
at org.apache.cassandra.thrift.IndexExpression.validate(IndexExpression.java:562)
at org.apache.cassandra.thrift.IndexExpression.write(IndexExpression.java:499)
at org.apache.cassandra.thrift.IndexClause.write(IndexClause.java:521)
at org.apache.cassandra.thrift.Cassandra$get_indexed_slices_args.write(Cassandra.java:13469)
at org.apache.cassandra.thrift.Cassandra$Client.send_get_indexed_slices(Cassandra.java:793)
at org.apache.cassandra.thrift.Cassandra$Client.get_indexed_slices(Cassandra.java:781)
at me.prettyprint.cassandra.service.KeyspaceServiceImpl$19.execute(KeyspaceServiceImpl.java:732)
那么,如何限制我的 indexedSliceQuery 只返回给定行键的结果?