All subcolumns for multiple supercolumns against a key in cassandra

两盒软妹~` 提交于 2019-12-12 04:07:05

问题


Can we read list of all available subcolumns for multiple supercolumns against a key in one request.

for example

we have a key "y1" with supercolumns x1,x2,x3

x1 has subcolumns with names like c1,c2,c3
x2 has subcolumns c9 and c8
x3 has c1,c3,c10

I want to read all the subcolumns in one request against one key "y1".


回答1:


You'll want to use a super slice query and specify a range. Here's a Hector example:

SuperSliceQuery query = HFactory.createSuperSliceQuery(keyspace, ... serializers ...);
query.setColumnFamily(columnFamily)
     .setKey(key)
     .setRange("", "", false, Integer.MAX_VALUE);


来源:https://stackoverflow.com/questions/10541044/all-subcolumns-for-multiple-supercolumns-against-a-key-in-cassandra

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!