Closed RaAleks closed 5 years ago
It is not an issue. By design Cassandra only allow you to use ORDER BY
on the 1st clustering column in your query
Oh, thanks for quick response, just tried query to cassandra in console, and you are absolutely right! Many thanks!
But if i write this request, cassandra allow me to make second clustering column in desc order. SELECT * FROM test WHERE partition= 'test' ORDER BY cluster1 DESC, cluster2 DESC;
But achilles not allows.
Which version of Cassandra are you using ?
Also please provide CREATE TABLE script
Here is create table CREATE TABLE test ( partition text, cluster1 text, cluster2 text, PRIMARY KEY (partition , cluster1 , cluster2 ) ); Version: [cqlsh 5.0.1 | Cassandra 3.11.3 | CQL spec 3.4.4 | Native protocol v4]
Hi @doanduyhai, i have a table such as below. So i want that Achilles returns me table with cluster2 in descending order. But Table_Select.W always returns W_Cluster1, that's why i can't see ability to set descending order for my second cluster. Also below code for test manager what i want to have.
@Table(table = "test_table") public class TestTable {
}
testTable_manager .dsl() .select() .allColumns_FromBaseTable() .where() .partition() .Eq("test") .orderByCluster2Descending() .groupBy() .cluster1_cluster2() .getList();