Strictly speaking, Cassandra is sorted primarily by the timestamp v1 UUID component, and in the case of binding, it is sorted by the remaining bytes:
int res = compareTimestampBytes(o1, o2); if (res != 0) return res; return o1.compareTo(o2);
phpcassa offers something similar to pycassa here. As a workaround, you can set the last 8 bytes of the return value to 0x00.
source share