cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Stevens <migh...@gmail.com>
Subject Re: BATCH OPERATION issue
Date Wed, 13 Sep 2017 21:33:28 GMT
The original timestamp is bigger than the timestamp you're using in your
batch.  Cassandra uses timestamps for conflict resolution, so the batch
write will lose.

On Wed, Sep 13, 2017 at 11:59 AM Deepak Panda <deepak.panda@gmail.com>
wrote:

> Hi All,
>
> Am in the process of learning batch operations. Here is what I tried.
>
> Executed a CQL query against the student table(student_id is the primary
> key).
>
>
> select student_id,position,WRITETIME(class_id),WRITETIME(position)
> FROM student WHERE student_id='s123';
>
> student_id position writetime(class_id) writetime(position)
> s123          1         1505293712083000 1505293712083000
>
>
> Then tried to update the "position" column using the following BATCH
> operation.
>
> BEGIN BATCH USING TIMESTAMP 1505291962469002
>  UPDATE
> student
> SET
> POSITION = 3
> WHERE
> student_id = 's123';
> APPLY BATCH;
>
> In this case the update does not take effect.
>
> But when I remove "USING TIMESTAMP" clause it works as expected.
>
> What could be the reason? I am using Casandra 3.11.
>
> Regards,
> AL
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@cassandra.apache.org
> For additional commands, e-mail: user-help@cassandra.apache.org
>
>

Mime
View raw message