When creating table in cassandra, we can give clustering keys with ordering like below.
Create table user(partitionkey int, id int, name varchar, age int, address text,
insrt_ts timestamp,
Primary key(partitionkey, name, insrt_ts, id)
with clustering order by (name asc, insrt_ts desc, id asc);
when we insert data into that table, As per cassandra documentation records are sorted based on clustering keys.
When i retrieve records with CQL1 and CQL2, I am getting in the same sorted order.
CQL1:
Select * from user where partitionkey=101;
CQL2:
Select * from user where partitionkey=101 order by name, insrt desc, id;
what is the difference between CQL1 and CQL2?