[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=17525589#comment-17525589 ] ROCHETEAU Antoine commented on CASSANDRA-10537: --- Great, just in time for the next release :). Thank you for the support and reviews ! > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.1 > > Time Spent: 3h 10m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.7#820007) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17525471#comment-17525471 ] Berenguer Blasi commented on CASSANDRA-10537: - Committed! thanks a lot [~Antoine Rocheteau] for your work and patience with our CI which has been a bit difficult these days :-) [j11|https://app.circleci.com/pipelines/github/bereng/cassandra/646/workflows/e6563adc-8346-41d5-982c-01e8249c96c8] CI [j8|https://app.circleci.com/pipelines/github/bereng/cassandra/646/workflows/d2ed1a1f-bdb5-4c18-8d30-96985cabdd23] CI C* [committed|https://github.com/apache/cassandra/commit/d80bb323c9dd8f814fe02e16dec510557c7d5101] dtest [committed|https://github.com/apache/cassandra-dtest/commit/5e06a1f5c192670b586abf8d1a68e4f884ba4e42] > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 3h 10m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.7#820007) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17524810#comment-17524810 ] Berenguer Blasi commented on CASSANDRA-10537: - [~Antoine Rocheteau] I checked and indeed I had submitted the wrong file to CI. Submitted again... > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 3h 10m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.7#820007) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17524801#comment-17524801 ] ROCHETEAU Antoine commented on CASSANDRA-10537: --- Hello, I'm confused because this upgrade tests report seems to refer to the old dtests code and not the one submitted on the [PR 180|[https://github.com/apache/cassandra-dtest/pull/180]]. Every 'CONTAINS' check should be evaluated according to the Cassandra node version within the following condition (and I don't see it on the test report): {code:java} if self.get_node_version(is_upgraded) >= LooseVersion(CASSANDRA_4_1){code} > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 3h 10m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.7#820007) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17524772#comment-17524772 ] Berenguer Blasi commented on CASSANDRA-10537: - Finally I got it to run. Apologies [~Antoine Rocheteau] we had problems in our CI. Seems upgrade tests are failing [here|https://app.circleci.com/pipelines/github/bereng/cassandra/644/workflows/da034812-e416-4e93-8ee9-8024c9d5197c/jobs/5772/tests#failed-test-7]. Notice how dtests are a shared repro between all C* versions. This is why you see some pieces or full tests protected by version ranges, so that only features that apply to a version get executed. On a quick check I don't think your changes to dtests have proper C* version constrains. My bad I forgot to mention that to you. > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 3h 10m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.7#820007) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17524198#comment-17524198 ] Berenguer Blasi commented on CASSANDRA-10537: - I haven't forgotten about this one. I am just hitting some weird errors I am trying to pin down #justfyi > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 3h 10m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17521570#comment-17521570 ] Berenguer Blasi commented on CASSANDRA-10537: - [~Antoine Rocheteau] I just fired a new CI and if all is good I'll squash, merge and do the full thing for you, no worries. > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 3h 10m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17521548#comment-17521548 ] ROCHETEAU Antoine commented on CASSANDRA-10537: --- Hello [~bereng], Failed test is fixed, I tested the autocomplete feature on a live instance because I did not succeed to execute this specific test but it should be OK now. Rebase is done on both repo, should I squash the commit now? > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 3h 10m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17521465#comment-17521465 ] Berenguer Blasi commented on CASSANDRA-10537: - [~Antoine Rocheteau] I fired a different CI run as jenkins seems to be having trouble now. There seems to be a small failure [here|https://app.circleci.com/pipelines/github/bereng/cassandra/640/workflows/c0e44dc1-f997-4cc9-9776-ef544be567e4/jobs/5681]. The rest of the [run|https://app.circleci.com/pipelines/github/bereng/cassandra/640/workflows/c0e44dc1-f997-4cc9-9776-ef544be567e4] lgtm though, those oversized mutation failures are unrelated to this ticket. Once that last failure is fixed I can merge :-) > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 3h 10m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17520467#comment-17520467 ] Berenguer Blasi commented on CASSANDRA-10537: - Let's see what [CI|https://ci-cassandra.apache.org/job/Cassandra-devbranch/1592/] has to say :-) > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 3h 10m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17520465#comment-17520465 ] Benjamin Lerer commented on CASSANDRA-10537: +1 Thanks a lot [~Antoine Rocheteau] > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 3h 10m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17520315#comment-17520315 ] Berenguer Blasi commented on CASSANDRA-10537: - [~blerer] please take a look when you have a gap and see if we are happy to merge this one :-) > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 3h 10m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17518905#comment-17518905 ] ROCHETEAU Antoine commented on CASSANDRA-10537: --- I made some changes in the PR on {{{}checkApplies*{}}}, {{checkDoesNotApplies*}} and {{{}checkInvalid*{}}}. Now every condition are tested on both '{{{}UPDATE'{}}} and '{{{}DELETE'{}}} statement (and this is not reserved to {{'CONTAINS'}} condition). > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 3h > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17518773#comment-17518773 ] ROCHETEAU Antoine commented on CASSANDRA-10537: --- I make some changes on the {{checkApplies, checkDoesNotApplies}} and {{checkInvalid}} methods to cover both {{UPDATE}} and {{DELETE}} statements for every condition evaluation. > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 3h > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17518676#comment-17518676 ] Berenguer Blasi commented on CASSANDRA-10537: - [~Antoine Rocheteau] I just took a look at your PR and unfortunately, unless I am missing sthg, we don't have any tests covering the {{DELETE}} path. We only seem to have a few that check for invalid requests etc but nothing covering this new functionality. I am afraid we will need that. > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 3h > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17518664#comment-17518664 ] ROCHETEAU Antoine commented on CASSANDRA-10537: --- Yes this would be great I think we are close :) I rebase both repo, did a small update on the documentation (limited to the syntax of UPDATE/DELETE statement, I don't think it's relevant to provide more details or example related to this patch). The autocompletion and related tests are up to date but unfortunately I'm not able to properly execute "test_cqlsh_completion" (probably a conflict with my OSX environment, i'm looking into it). Finally, I add some assertion on the tests listed by [~blerer] but this may be not enough. We could add new tests similar to {{testWholeList,testWholeSet}} and {{testWholeMap}} to fully covered conditional delete statement on collection (and not only for CONTAINS operators) but I'm not sure this is really necessary. > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 2h 50m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17517912#comment-17517912 ] Berenguer Blasi commented on CASSANDRA-10537: - [~Antoine Rocheteau] there are talks in the ML about an upcoming release, just in case you'd like to get this one in and go live :-) > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 2h 50m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17515806#comment-17515806 ] Berenguer Blasi commented on CASSANDRA-10537: - ^and docs :-) > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 2h 50m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17515794#comment-17515794 ] Benjamin Lerer commented on CASSANDRA-10537: [~Antoine Rocheteau] Yes CONTAINS conditions applies to UPDATE and DELETE. For some reason I though that the existings {{InsertUpdateIfConditionCollectionsTest}} were also covering DELETE operations. We appear to have a gap there. Good catch! :-) It would be great if you could add some tests to: {{testMapItem}}, {{testListItem}} and to {{testNonFrozenEmptyCollection}}. > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 2h 50m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17515718#comment-17515718 ] Berenguer Blasi commented on CASSANDRA-10537: - You're right {{columnCondition}} seems to be shared both by {{UPDATE}} and {{DELETE}} statements. We have to decide if we want to go full in and add {{DELETE}} support (docs, junit,...) or amend it to constrain it only to {{UPDATE}}. That would be a decision for [~blerer] imo as he might be aware of upcoming changes in that area I may not be. > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 2h 50m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17515376#comment-17515376 ] ROCHETEAU Antoine commented on CASSANDRA-10537: --- I just realized that this patch is not limited to conditional UPDATE statement, it concerns in the same way conditional DELETE statement: {code:java} DELETE FROM myTable WHERE k=0 IF l CONTAINS 'bar';{code} This statement will be valid and executed if the condition apply. This is maybe obvious and not a problem at all but today it's not reflected on any tests AFAIK. Can I have your opinion on this? If everything is fine I will update the autocompletion feature and the documentation accordingly (on both update and delete statement). > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 2h 50m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17515085#comment-17515085 ] Berenguer Blasi commented on CASSANDRA-10537: - [~Antoine Rocheteau] so the latest stretch would be to: - Add autocompletion + tests - Add docs (search for .adoc files) - Add en entry to CHANGES.txt - Last rebase and if CI is good I'll merge this for you We're almost there :-) Feel free to ask for help if you need anything. > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 2h 50m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17514664#comment-17514664 ] Benjamin Lerer commented on CASSANDRA-10537: I realized that we also need to update the CQLSH auto-completion in pylib/cqlshlib/cql3handling.py for {{}}. Outside of that the patch look good to me. :-) > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 2h 50m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17514049#comment-17514049 ] ROCHETEAU Antoine commented on CASSANDRA-10537: --- Good to hear :). Rebase is done on both repo and I will try to keep them up to date on a regular basis > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 2h 50m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17513943#comment-17513943 ] Berenguer Blasi commented on CASSANDRA-10537: - [~Antoine Rocheteau] your latest CI looks much better. If you could rebase the C* trunk PR when you have some time that'd be awesome, so it would be easier to match failures to the current state. Now we need to wait for [~blerer] or some other committer to take a look here. > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 2h 50m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17513800#comment-17513800 ] Berenguer Blasi commented on CASSANDRA-10537: - Let's see what [CI|https://ci-cassandra.apache.org/job/Cassandra-devbranch/1547/] does :-) > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 2h 50m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17512889#comment-17512889 ] ROCHETEAU Antoine commented on CASSANDRA-10537: --- Hello [~bereng], I solve my local issue and dtests are running fine now. I make some changes on the [PR|https://github.com/apache/cassandra-dtest/pull/180] of the dtests repo and the "test_whole_{_}collection{_}_conditional" are fixed (I didn't find any other failure of the CI build related to this ticket so I hope I didn't miss anything). > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 2h 50m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17510371#comment-17510371 ] Berenguer Blasi commented on CASSANDRA-10537: - [~Antoine Rocheteau] check the README. You should be able to execute the tests locally after having set up the local virtual env etc. If you need help solving the issues feel free to ping me on Slack, email or whatever. > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 2h 50m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17510355#comment-17510355 ] ROCHETEAU Antoine commented on CASSANDRA-10537: --- Unfortunately I did not succeed to execute any DTests on my dev machine for the moment. I submit a [PR|https://github.com/apache/cassandra-dtest/pull/180] "in the dark" with some obvious changes on the following tests : * test_whole_map_conditional * test_whole_list_conditional * test_whole_set_conditional And I will try to solve my environnement issue asap > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 2h 50m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17506715#comment-17506715 ] Berenguer Blasi commented on CASSANDRA-10537: - Hi [~Antoine Rocheteau] that is correct. Fork it, PR, I will review etc. [Here|https://ci-cassandra.apache.org/job/Cassandra-trunk/] is the current state of trunk in terms of CI so you can work out which failures need fixing in this ticket. > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 2h 50m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17506359#comment-17506359 ] ROCHETEAU Antoine commented on CASSANDRA-10537: --- Hello [~bereng] , DTests have to be updated as well. I suppose I should also submit a PR on the [cassandra-dtest|https://github.com/apache/cassandra-dtest] repo ? > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 2h 50m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17506167#comment-17506167 ] Berenguer Blasi commented on CASSANDRA-10537: - Hi [~Antoine Rocheteau], there seem to be some failures related to this patch. Please remember to let us know if you need help with them. > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 2h 50m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17506029#comment-17506029 ] Berenguer Blasi commented on CASSANDRA-10537: - Let's see how [CI goes|https://ci-cassandra.apache.org/job/Cassandra-devbranch/1497/] and then we can merge this guy. > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 2h 50m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17502726#comment-17502726 ] Berenguer Blasi commented on CASSANDRA-10537: - Sorry [~e.dimitrova] I missed your message, good that Benjamin can jump on it :-) > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 1h 40m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17499658#comment-17499658 ] Benjamin Lerer commented on CASSANDRA-10537: [~e.dimitrova] I wanted to have a deeper look at the patch but forgot about it. I should have time tomorrow. :-) > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 1h 40m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17499607#comment-17499607 ] Ekaterina Dimitrova commented on CASSANDRA-10537: - [~bereng] , [~blerer] you still need a committer here or shall we move it to Review in Progress? > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 1h 40m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17484146#comment-17484146 ] ROCHETEAU Antoine commented on CASSANDRA-10537: --- Thanks for the feedback, i did some changes and add units tests as you suggested :) I answered your comment on possible use of the _compareWithOperator_ method because i'm not sure about how to handle this: [https://github.com/apache/cassandra/pull/1380#discussion_r794356278] > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 50m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17477050#comment-17477050 ] Berenguer Blasi commented on CASSANDRA-10537: - I dropped a few comments. Hope they make sense :-) > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.x > > Time Spent: 40m > Remaining Estimate: 0h > > 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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17471853#comment-17471853 ] Benjamin Lerer commented on CASSANDRA-10537: {quote}Modifications are quite light so i haven't started the refactoring of ColumnCondition mentioned by Alex Petrov (even if i'm agree on its benefits).{quote} The comment from [~ifesdjeen] is an old one. We did refactor the code since then :-) > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Assignee: ROCHETEAU Antoine >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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=17469970#comment-17469970 ] ROCHETEAU Antoine commented on CASSANDRA-10537: --- Hello, I just take a look into this improvement and so far this is the current state of my working branch: Use of *CONTAINS* operator is allowed on collection (evaluation of the condition is performed on lists, sets and maps values) Use of *CONTAINS KEY* operator is allowed on map only (evaluation is performed on map keyset) So these conditions are now valid and working: {{IF list_column CONTAINS 'bar'}} {{IF set_column CONTAINS 'bar'}} {{IF map_column CONTAINS 'bar'}} {{IF map_column CONTAINS KEY 'foo'}} These are not and will throw an {_}InvalidRequestException{_}: {{IF list_column CONTAINS KEY 'bar'}} {{IF set_column CONTAINS KEY 'bar'}} {{IF text_column CONTAINS 'bar'}} Finally, these are still throwing a {_}SyntaxException{_}: {{IF list_column[1] CONTAINS 'bar'}} {{IF map_column['foo'] CONTAINS 'bar'}} {{IF udt_column.a CONTAINS 'bar' }} Modifications are quite light so i haven't started the refactoring of _ColumnCondition_ mentioned by [~ifesdjeen] (even if i'm agree on its benefits). Should I submit a pull request in this current state or did i miss something ? Best regards, Antoine > 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 > Components: Legacy/CQL >Reporter: Nimi Wariboko Jr. >Priority: Normal > Labels: AdventCalendar2021, CQL, lhf > Fix For: 4.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)? > +Additional Information for newcomers:+ > Negation should not be supported as for the moment we do not support it > within restrictions either. > One way to approch this bug is to use test driven development. You can modify > {{InsertUpdateIfConditionCollectionsTest}} to allow CONTAINS and CONTAINS KEY > operators and go through the different failures. > The following changes will need to be done. > * The {{columnCondition}} rule from the ANTLR {{Parser.g}} file should be > updated to accept {{containsOperator}}. > * {{ColumnCondition.Raw#prepareTerms}} should be modified in the case where > the operator is a CONTAINS or CONTAINS KEY as the {{receiver}} is not the > collection but keys or values of the collection. Look at > {{SingleColumnRelation#makeCollectionReceiver}}. > * {{ColumnCollection.MultiCellCollectionBound#valueAppliesTo}} will need to > be changed for {{Map}} and {{Set}} to process CONTAINS operators. > -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[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)