0

I'm having trouble sorting by key when calling get_range() on a column family.

  • The keys are TimeUUID
  • the key validation class is org.apache.cassandra.db.marshal.TimeUUIDType
  • the partitioner is "ByteOrderedPartitioner"

When I call get_range() the results are not returned in the correct order, though. Any thoughts on what I might be doing wrong here?

giampaolo
  • 6,906
  • 5
  • 45
  • 73
coleifer
  • 24,887
  • 6
  • 60
  • 75
  • Did you configured the partitioner (and restart the server) before create the keyspace? – sahid Jul 24 '12 at 15:53

1 Answers1

3

ByteOrderedPartitioner orders by bytes, as the name suggests. Since the "time" component of a version 1 uuid is not the first bytes, this is NOT the same as TimeUUID ordering.

I suggest reading up on time series modeling in Cassandra: http://rubyscale.com/blog/2011/03/06/basic-time-series-with-cassandra/ and http://www.datastax.com/dev/blog/advanced-time-series-with-cassandra

jbellis
  • 19,347
  • 2
  • 38
  • 47