alter composite primary key in cassandra CQL 3.0

后端 未结 2 430
予麋鹿
予麋鹿 2021-01-01 09:58

I\'m in a situation where I need to change the the composite primary key as follows:

Old Primary Key: (id, source, attribute_name, updated_at);

2条回答
  •  耶瑟儿~
    2021-01-01 10:45

    There is no way to change a primary key, as it defines how your data is physically stored.

    You can create a new table with the new primary key, copy data from the old one, and then drop the old table.

提交回复
热议问题