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

Sylvain Lebresne commented on CASSANDRA-3647:
---------------------------------------------

I've rebased and changed the syntax to match what's above. The new branch is at 
https://github.com/pcmanus/cassandra/commits/3647-2.

To sum up the new syntax:
* lists:
{noformat}
UPDATE L = L + [ 'a' , 'b' ] WHERE ... // Appends to list
UPDATE L = [ 'a' , 'b' ] + L WHERE ... // Prepends to list
UPDATE L[1] = 'c' WHERE ...            // Sets by idx
UPDATE L = L - [ 'a', 'b' ] WHERE ...  // Remove all occurences of value 'a' 
and 'b' in list
DELETE L[1] WHERE ...                  // Deletes by idx
{noformat}
* sets:
{noformat}
UPDATE S = S + { 'a', 'b' } WHERE ... // Adds to set
UPDATE S = S - { 'a', 'b' } WHERE ... // Remove values 'a' and 'b' from set
{noformat}
* maps:
{noformat}
UPDATE M['a'] = 'c' WHERE ...          // Put key,value
UPDATE M = M + { 'a' : 'c' } WHERE ... // Equivalent to previous
DELETE M['a'] WHERE ...                // Remove value for key 'a'
{noformat}

A few remarks:
* We could rename list -> array. I figured one reason to keep list could be to 
emphasize that there is no predefined size. But I'm good with array.
* There is no support, for maps, of
{noformat}
UPDATE M = M - { 'a' : 'c' } WHERE ...
{noformat}
or some other syntax to remove a element of a map by value. The reason is that 
I don't think we can implement that correctly due to concurrency.

                
> Support set and map value types in CQL
> --------------------------------------
>
>                 Key: CASSANDRA-3647
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3647
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API, Core
>            Reporter: Jonathan Ellis
>            Assignee: Sylvain Lebresne
>              Labels: cql
>             Fix For: 1.2
>
>
> Composite columns introduce the ability to have arbitrarily nested data in a 
> Cassandra row.  We should expose this through CQL.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to