-
Notifications
You must be signed in to change notification settings - Fork 310
Description
Luc Boutier opened DATACASS-842 and commented
When migrating a project from cassandra 2.x to 3.x I encountered an issue in the ordering of sort parameters.
The clustering key of my object contains (in order) fields repairOrderId and revisionId and I was using the following query
val query = query(where("partitionKey").is
(partitionKey)).sort(by(DESC, "repairOrderId", "revisionId"))
return cassandraTemplate.selectOne(query, RepairOrderByBasket::class.java)
It seems that somehow the sort is mixing up and creates a statement with
ORDER BY revisionId DESC, repairOrderId DESC
that cassandra does not support (it requires the same order as clustering keys so
ORDER BY repairOrderId DESC, revisionId DESC
In my particular case it was actually just better to use a clustering ordering on the table definition rather than at the query level but I guess this can be an issue in some other context
No further details from DATACASS-842