Skip to content

Regression in support of sort in queries [DATACASS-842] #1008

@spring-projects-issues

Description

@spring-projects-issues

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

Metadata

Metadata

Assignees

Labels

type: regressionA regression from a previous release

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions