All subcolumns for multiple supercolumns against a

2019-08-22 05:31发布

问题:

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);