How do I maintain the order of execution of statements inside a batch in Cassandra? I am trying to insert a record and then update that same record in the second statement but it seems that the order is not being followed.
Asked
Active
Viewed 641 times
1 Answers
4
Batches aren't really meant for ordering things time wise but if you wish to do that, what you need to do is add timestamps to each statement. Usually, a batch will give the same timestamp to all operations in that batch which can lead to the results you've witnessed so far. By explicitly time-stamping you can specify the order you want.

RussS
- 16,476
- 1
- 34
- 62
-
This was also addressed in https://stackoverflow.com/questions/30317877/cassandra-batch-statement-execution-order – user1694845 Aug 12 '18 at 23:01