Re: CQL error when adding multiple conditional update statements in the same batch

2015-10-08 Thread sai krishnam raju potturi
could you also provide the columnfamily schema.

On Thu, Oct 8, 2015 at 4:13 PM, Peddi, Praveen  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
>
>


Re: CQL error when adding multiple conditional update statements in the same batch

2015-10-08 Thread Tyler Hobbs
I assume you're running Cassandra 2.0?

In 2.1.1 the check for "incompatible" conditions was removed (see this
comment

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 <
pskraj...@gmail.com> wrote:

> could you also provide the columnfamily schema.
>
> On Thu, Oct 8, 2015 at 4:13 PM, Peddi, Praveen  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 


Re: CQL error when adding multiple conditional update statements in the same batch

2015-10-08 Thread Peddi, Praveen
Sorry Cassandra 2.0.9 (I was using 2.0.8 but there was another bug in 2.0.8 so 
upgraded to 2.0.9)

On Oct 8, 2015, at 4:43 PM, Peddi, Praveen 
<pe...@amazon.com<mailto:pe...@amazon.com>> wrote:

Cassandra 2.0.8.





From: Tyler Hobbs <ty...@datastax.com<mailto:ty...@datastax.com>>
Reply-To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
<user@cassandra.apache.org<mailto:user@cassandra.apache.org>>
Date: Thursday, October 8, 2015 at 4:41 PM
To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
<user@cassandra.apache.org<mailto:user@cassandra.apache.org>>
Subject: Re: CQL error when adding multiple conditional update statements in 
the same batch

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=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 
<pskraj...@gmail.com<mailto:pskraj...@gmail.com>> wrote:
could you also provide the columnfamily schema.

On Thu, Oct 8, 2015 at 4:13 PM, Peddi, Praveen 
<pe...@amazon.com<mailto:pe...@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/>


Re: CQL error when adding multiple conditional update statements in the same batch

2015-10-08 Thread Peddi, Praveen
Cassandra 2.0.8.





From: Tyler Hobbs <ty...@datastax.com<mailto:ty...@datastax.com>>
Reply-To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
<user@cassandra.apache.org<mailto:user@cassandra.apache.org>>
Date: Thursday, October 8, 2015 at 4:41 PM
To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
<user@cassandra.apache.org<mailto:user@cassandra.apache.org>>
Subject: Re: CQL error when adding multiple conditional update statements in 
the same batch

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=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 
<pskraj...@gmail.com<mailto:pskraj...@gmail.com>> wrote:
could you also provide the columnfamily schema.

On Thu, Oct 8, 2015 at 4:13 PM, Peddi, Praveen 
<pe...@amazon.com<mailto:pe...@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/>