Cassandra-CQl: changing the clustering order for the created column family

I know that I can determine the order of clustering when I create the cql table as the code below:

create table test( id int, time timestamp, value text, primary key(id,time)) with clustering order by (time desc) 

but I want to change the clustering for a table test after creating it with alter:

 alter table test with clustering order by (item asc) 

but I got an error. Thanks for any help.

+6
source share
1 answer

You cannot, because for this you will need to rewrite all your data to disk in a different order, resorting at runtime until the rewriting is completed, which will lead to an unacceptable result. You will need to create a new table and load it into.

+11
source

Source: https://habr.com/ru/post/950729/


All Articles