0

I have this problem with Cassandra to use ORDER by

this is my query

public static final Select GET_USERS = QueryBuilder.select().all().from("user");

But When I use Order By Have a problem with this

Caused by: com.datastax.driver.core.exceptions.InvalidQueryException: ORDER BY is only supported when the partition key is restricted by an EQ or an IN.

Could you please help me how to use order by on my query?

He Cris
  • 45
  • 6

1 Answers1

0

You need to specify a partition key to query using order by clause. Below SO post has details on how ORDER BY clause work in Cassandra. Hopefully, that will help you clarify

Where and Order By Clauses in Cassandra CQL