If I define a table like this using cql:
CREATE TABLE scores ( name text, age int, score int, date timestamp, PRIMARY KEY (name, age, score) );
And do SELECT in cqlsh as follows:
select * from mykeyspace.scores;
The displayed result is always sorted by "age", then "rating" automatically in ascending order, regardless of the order of data entry (as expected, the return lines are not sorted by the key in the "name" section). I have the following questions:
SELECT automatically sorts returned rows with clustering keys?- If so , what is the purpose of using the
ORDER BY when using SELECT ? - If not , how to get returned rows for sorting using clustering keys, since cql does not allow
ORDER BY on select * ?
cassandra cql cqlsh
ptmoy2
source share