cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rafael Ribeiro <rafae...@gmail.com>
Subject Re: range get over subcolumns on supercolumn family
Date Mon, 26 Apr 2010 18:56:13 GMT
Just found the way...
keyRange start and end key will be the same and instead of specifying the
count and start on KeyRange it has to be specified on SliceRange and then
keySlices will come with a single key and a list of columns...



2010/4/25 Rafael Ribeiro <rafaelri@gmail.com>

> Hi all!
>
>  I am trying to do a paginated query on the subcolumns of a superfamily
> column but sincerely I am a little bit confused.
>  I have already been able to do a range query but only over the keys of a
> regular column family.
>  For the keys case I've been able to do so using the code below:
>
>             KeyRange keyRange = new KeyRange(count);
>             keyRange.setStart_key(startKey);
>             keyRange.setEnd_key("");
>
>             SliceRange range = new SliceRange();
>             range.setStart(new byte[] {});
>             range.setFinish(new byte[] {});
>
>             SlicePredicate predicate = new SlicePredicate();
>             predicate.setSlice_range(range);
>
>             ColumnParent cp = new ColumnParent("ColumnFamily");
>
>             List<KeySlice> keySlices = client.get_range_slices("Keyspace",
> cp, predicate, keyRange, ConsistencyLevel.ALL);
>
>  Is there any way I can do a similar approach to do the range query on the
> subcolumns? Would I need to do some trick over ColumnParent? I tried setting
> the supercolumn attribute but with no success (sincerely I knew it wont work
> but it was worth trying). Only to clarify a little bit... I am still
> exercising what is possible to do with Cassandra and I was willing to store
> a key over a supercolumnfamily with uuid keys under it so I could scan it
> using an ordering scheme but without loading the whole data under the top
> level key.
>
> best regards,
> Rafael Ribeiro
>
>

Mime
View raw message