How do you update all column values ​​in Cassandra without specifying keys?

Let's say I have the following table (only more):

key | type ---------------- uuid1 | blue uuid2 | red uuid3 | blue 

What I want to do is change all that is blue to green . How can I do this without specifying all the UUIDs with the CLI or CQL?

+4
source share
1 answer

You have several options:

  • You can put the secondary index in the "type" column and then query for all elements equal to "blue". Once you have everything, you will have all your keys, and you can do a batch mutation to set all the values ​​to green.

  • You can use Hadoop integration to read across all columns and then output the updated data to your reducer. A pig would be a good choice for this kind of work.

+3
source

All Articles