Suppose I have a keyspace with a column family that stores user objects, and the key to these objects is the username.
How can I use Hector to get a list of users sorted by username?
I tried using RangeSlicesQuery, paging works fine with this query, but the results are not sorted in any way.
I'm an absolute Cassandra newbie, can someone point me to a simple example that shows how to sort a column family by key? Please ask if you need more information about my efforts.
Edit:
The result was not sorted because I used the DefaultPartitioner by default instead of OrderPreseveringPartitioner in cassandra.yaml.
It is probably best not to rely on sorting by key, but to use a secondary index.
source share