I want to execute some range queries on a table that is structured like:
CREATE TABLE table(
num int,
val1 int,
val2 float,
val3 text,
...
PRIMARY KEY(num)
Using Byte Order Partitioner is an anti-pattern in Cassandra for sure, but if you still want to go ahead with it, then you can achieve the above functionality of range queries over partition key using the token function.
SELECT num, val1, val2 FROM tableorderedbynum WHERE someotherkey = 'yourvalue' AND
token(num) > token(100) AND token(num) < token(1000);
Please be advised similar queries will fail to provide desired results when using Random Partitioner or Murmur3 Partitioner because token's are not generated in order but are random in nature.