1

I know i can reverse the column order like:

$rows = $test->get_range("", "", 10, NULL, "", "", true);

But keys are in db like 1, 2, 3, 4 I want to get the latest 10 keys, and then do like reverse paging. So i basically want first in first out. What would be the best method?

Sure I could get all the keys out of cassandra and then reverse them by php but there must be something more elegant.

Writecoder
  • 613
  • 2
  • 8
  • 27

1 Answers1

1

If you're using RandomPartition (which you almost certainly should be, see here for more info on picking a partitioner), you cannot get an ordered range of keys. Even if you're using an OrderedPartitioner, there's no way to get a range of keys in reverse.

To achieve what you're trying to do, use rows where the column names are what you are currently using for row keys, and simply get a reversed slice of columns with limit 10.

Tyler Hobbs
  • 6,872
  • 24
  • 31