0
votes

I want to do batch update for all rows, using update query. I know there is BATCH query. But, I have to list all rows..

So, I want to do something like :

UPDATE test set value=0x31 where id in ( SELECT id from test );

Is there any way doing something like the above?

The idea is the same as SQL. select all rows & and insert them into "in" part.

The reason why I want to do this is that I added a new column to the existing column family, which created null data in the new created column. And, this cause an error for retrieving data from Cassandra.

1

1 Answers

0
votes

I think the examples shown here might help: http://www.datastax.com/documentation/cql/3.1/cql/cql_reference/update_r.html?scroll=reference_ds_g4h_qzq_xj__description_unique_31

Update a column in several rows at once:

UPDATE users SET state = 'TX' WHERE user_uuid IN (88b8fd18-b1ed-4e96-bf79-4280797cba80, 06a8913c-c0d6-477c-937d-6c1b69a95d43, bc108776-7cb5-477f-917d-869c12dfffa8);