[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] [Comment Edited] (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 edited comment on CASSANDRA-10537 at 4/20/22 8:51 AM: 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} was (Author: antoine rocheteau): 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=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=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=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] (CASSANDRA-10537) CONTAINS and CONTAINS KEY support for Lightweight Transactions
[ https://issues.apache.org/jira/browse/CASSANDRA-10537 ] ROCHETEAU Antoine deleted comment on CASSANDRA-10537: --- was (Author: antoine rocheteau): 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=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=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=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=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=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=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=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=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] [Comment Edited] (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 edited comment on CASSANDRA-10537 at 1/7/22, 8:36 AM: 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 ?- [PR 1380|https://github.com/apache/cassandra/pull/1380] Best regards, Antoine was (Author: antoine rocheteau): 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=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