[ 
https://issues.apache.org/jira/browse/CASSANDRA-5633?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13682450#comment-13682450
 ] 

Aleksey Yeschenko commented on CASSANDRA-5633:
----------------------------------------------

We only support updating several rows using BATCH in cql3, so this would 
somehow involve BATCH as well.

Maybe some new kind of BATCH, CAS BATCH?

{noformat}
BEGIN CAS BATCH
UPDATE foo SET x = 10 WHERE bar = 1 AND baz = 'k' IF x = 9
UPDATE foo SET y = 15 WHERE bar = 1 AND baz = 'y' IF y = 7
DELETE FROM foo WHERE bar = 1 AND baz = 'z' IF NOT EXISTS
APPLY BATCH
{noformat}

We'll validate the partition key is the same (bar) and merge all the conditions 
together (all the updates, too) and it will only apply if all the conditions 
are true.
Not all statements even have to involve CAS, but at least one should.

It's not perfect, just the first thing that came to mind.
                
> CQL support for updating multiple rows in a partition using CAS
> ---------------------------------------------------------------
>
>                 Key: CASSANDRA-5633
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-5633
>             Project: Cassandra
>          Issue Type: Improvement
>    Affects Versions: 2.0
>            Reporter: sankalp kohli
>            Priority: Minor
>              Labels: cql3
>             Fix For: 2.0
>
>
> This is currently supported via Thrift but not via CQL. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to