You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Alex Petrov (JIRA)" <ji...@apache.org> on 2016/06/24 13:23:16 UTC
[jira] [Commented] (CASSANDRA-10537) CONTAINS and CONTAINS KEY
support for Lightweight Transactions
[ https://issues.apache.org/jira/browse/CASSANDRA-10537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15348246#comment-15348246 ]
Alex Petrov commented on CASSANDRA-10537:
-----------------------------------------
I've made a simple proof of concept to check how simple it would be to support this.
It's rather easy, as it requires a small change in grammar, although given the way the {{ColumnCondition}} is currently implemented, I'd suggest refactoring it a bit to make it more flexible to support different operations.
* {{ColumnCondition}} supports at least two cases in a single class: for operators such as {{EQ}}, {{GT}} etc.. and {{IN}}. These cases are mostly distinct and code might get simpler to read and modify if we had them in distinct classes
* Other strong distinction that's made is between (for collection) the field and collection element (for UDT), and "simple" values.
There are enough inner classes that handle all the mentioned distinctions, but {{ColumnCondition}} itself may benefit from reducing the amount of conditional logic involved into figuring out distinction, as code paths are rather separate.
> CONTAINS and CONTAINS KEY support for Lightweight Transactions
> --------------------------------------------------------------
>
> Key: CASSANDRA-10537
> URL: https://issues.apache.org/jira/browse/CASSANDRA-10537
> Project: Cassandra
> Issue Type: Improvement
> Reporter: Nimi Wariboko Jr.
> Assignee: Alex Petrov
> Labels: CQL
> Fix For: 3.x
>
>
> Conditional updates currently do not support CONTAINS and CONTAINS KEY conditions. Queries such as
> {{UPDATE mytable SET somefield = 4 WHERE pk = 'pkv' IF set_column CONTAINS 5;}}
> are not possible.
> Would it also be possible to support the negation of these (ex. testing that a value does not exist inside a set)?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)