Undrooleek
Undrooleek

Reputation: 223

How to change the key of row in cassandra?

I need to change(to update it with new value) the key of row in cassandra. How can i do that? Of course i can select all rows with previos key and then insert their columns with new key, and delete the previos rows. this is too hard. maybe there is another way to solve this prolem?

Upvotes: 4

Views: 1351

Answers (2)

Jonas Geiregat
Jonas Geiregat

Reputation: 5432

What you could do is copy the entire row and insert it again with your new row key.

Upvotes: 2

Theodore Hong
Theodore Hong

Reputation: 1787

Unfortunately you can't change the key of a row - that would incur too much overhead (for example, you might have to move the row to a different host).

Upvotes: 2

Related Questions