You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Brian Tarbox <ta...@cabotresearch.com> on 2014/04/01 16:53:38 UTC

Specifying startBefore with iterators with compositeKeys

I have a composite key consisting of: (integer, bytes) and I have rows like:
(1,abc), (1,def), (2,abc), (2,def) and I want to find all rows with the
integer part = 2.

I need to create a startBeyondName using CompositeType.Builder class and am
wondering if specifying (2, Bytes.Empty) will sort correctly?

I think another way of saying this is: "does HeapByteBuffer with
pos=,lim=0,cap=0 sort prior to any other possible HeapByteBuffer?

Thanks.

Re: Specifying startBefore with iterators with compositeKeys

Posted by Tyler Hobbs <ty...@datastax.com>.
On Tue, Apr 1, 2014 at 9:53 AM, Brian Tarbox <ta...@cabotresearch.com>wrote:

> I think another way of saying this is: "does HeapByteBuffer with
> pos=,lim=0,cap=0 sort prior to any other possible HeapByteBuffer?


Yes.  However, if you use it as a slice finish, an empty ByteBuffer is
greater than any other value.


-- 
Tyler Hobbs
DataStax <http://datastax.com/>