cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tyler Hobbs <ty...@datastax.com>
Subject Re: CQL error when adding multiple conditional update statements in the same batch
Date Thu, 08 Oct 2015 20:41:39 GMT
I assume you're running Cassandra 2.0?

In 2.1.1 the check for "incompatible" conditions was removed (see this
comment
<https://issues.apache.org/jira/browse/CASSANDRA-6839?focusedCommentId=14097793&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14097793>
for details).  I wouldn't be surprised if that check didn't work properly
for batch statements in 2.0.

On Thu, Oct 8, 2015 at 3:22 PM, sai krishnam raju potturi <
pskraju88@gmail.com> wrote:

> could you also provide the columnfamily schema.
>
> On Thu, Oct 8, 2015 at 4:13 PM, Peddi, Praveen <peddi@amazon.com> wrote:
>
>> Hi,
>>
>> I am trying to understand this error message that CQL is throwing when I
>> try to update 2 different rows with different values on same conditional
>> columns. Doesn't CQL support that? I am wondering why CQL has this
>> restriction (since condition applies to each row independently, why does
>> CQL even care if the values of the condition is same or different).
>>
>> BEGIN BATCH
>>     UPDATE activities SET state='CLAIMED',version=11 WHERE key='Key1' IF version=10;
>>     UPDATE activities SET state='ALLOCATED',version=2 WHERE key='Key2' IF version=1;
>> APPLY BATCH;
>>
>> gives the following error
>>
>> Bad Request: Duplicate and incompatible conditions for column version
>>
>> Is there anyway to update more than 1 row with different conditional
>> value for each row (other than executing these statements individually)?
>> -Praveen
>>
>>
>


-- 
Tyler Hobbs
DataStax <http://datastax.com/>

Mime
View raw message