incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Ellis <jbel...@gmail.com>
Subject Re: Start key must sort before (or equal to) finish key in your partitioner
Date Mon, 31 May 2010 18:52:32 GMT
OPP uses lexical ordering on the keys, which isn't going to be the
same as the natural order for a time-based uuid.

On Mon, May 31, 2010 at 2:57 AM, Leslie Viljoen <leslieviljoen@gmail.com> wrote:
> Hello!
>
> I am using an OrderPreservingPartitioner and sequential UUID's as
> keys. When I use get_range I frequently get an error indicating that
> my start key is not before or equal to my finish key, which seems
> impossible. The code to request slices looks like this:
>
> sometime = Time.now
> a = UUIDTools::UUID.timestamp_create(sometime)
> b = UUIDTools::UUID.timestamp_create(sometime + 1)
> slice = @cassandra.get_range(:ReportData, :start => a.to_s, :finish => b.to_s)
> puts "SORT ERROR!" if a >= b    # this never displays
>
>
>
> This is the error I get:
>
> /usr/lib/ruby/gems/1.8/gems/cassandra-0.8.2/lib/../vendor/gen-rb/cassandra.rb:152:in
> `recv_get_range_slices': start key must sort before (or equal to)
> finish key in your partitioner!
> (CassandraThrift::InvalidRequestException)
>        from /usr/lib/ruby/gems/1.8/gems/cassandra-0.8.2/lib/../vendor/gen-rb/cassandra.rb:142:in
> `get_range_slices'
>        from /usr/lib/ruby/gems/1.8/gems/thrift_client-0.4.0/lib/thrift_client.rb:140:in
> `send'
>        from /usr/lib/ruby/gems/1.8/gems/thrift_client-0.4.0/lib/thrift_client.rb:140:in
> `proxy'
>        from (eval):1:in `get_range_slices'
>        from /usr/lib/ruby/gems/1.8/gems/cassandra-0.8.2/lib/cassandra/protocol.rb:78:in
> `_get_range'
>        from /usr/lib/ruby/gems/1.8/gems/cassandra-0.8.2/lib/cassandra/cassandra.rb:230:in
> `get_range'
>        from ./read.rb:29:in `get_range'
>        from ./read.rb:62
>        from ./read.rb:58:in `loop'
>        from ./read.rb:58
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com

Mime
View raw message