You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jonathan Ellis (JIRA)" <ji...@apache.org> on 2013/06/13 20:17:20 UTC

[jira] [Comment Edited] (CASSANDRA-5633) CQL support for updating multiple rows in a partition using CAS

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

Jonathan Ellis edited comment on CASSANDRA-5633 at 6/13/13 6:16 PM:
--------------------------------------------------------------------

How about this?

{code}
UPDATE foo SET x = 10 WHERE partition='key' AND bar=1
IF (SELECT y FROM foo WHERE partition='key' AND baz = 2) = 3
{code}

Pro:
# Good match with semantics of what CAS actually does under the hood
# Fairly natural for SQL users

Con:
# Need to invent syntax for multiple columns ({{IF (SELECT y, z ...) = (3, 4)}})
# Risks confusing people who wonder why we don't support subqueries elsewhere
# Not necessarily obvious that subquery is restricted to the same partition
                
      was (Author: jbellis):
    How about this?

{code}
UPDATE foo SET x = 10 WHERE bar = 1
IF (SELECT y FROM foo WHERE baz = 2) = 3
{code}

Pro:
# Good match with semantics of what CAS actually does under the hood
# Fairly natural for SQL users

Con:
# Need to invent syntax for multiple columns ({{IF (SELECT y, z ...) = (3, 4)}})
# Risks confusing people who wonder why we don't support subqueries elsewhere
                  
> 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