Ask Your Question
0

The CQL query is returning an error message stating that the use of "ORDER BY" is only permitted when the partition key is restricted by "EQ" or "IN".

asked 2022-12-06 11:00:00 +0000

lakamha gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-05-05 20:00:00 +0000

pufferfish gravatar image

This error message occurs because in Cassandra, ORDER BY can only be used when querying on the partition key using the "EQ" or "IN" operator. This is because Cassandra stores data in partitions, and when querying on a partition key, the data is already sorted within that partition.

To resolve this error, modify the CQL query so that it includes a restriction on the partition key using "EQ" or "IN". Alternatively, if sorting is needed on another column, consider denormalizing the data and creating a new table with the desired ordering.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-12-06 11:00:00 +0000

Seen: 11 times

Last updated: May 05 '22