You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2022/03/09 10:48:47 UTC

[GitHub] [cassandra] blerer commented on a change in pull request #1380: CASSANDRA-10537: CONTAINS and CONTAINS KEY support for Lightweight Transactions

blerer commented on a change in pull request #1380:
URL: https://github.com/apache/cassandra/pull/1380#discussion_r822515048



##########
File path: test/unit/org/apache/cassandra/cql3/validation/operations/InsertUpdateIfConditionCollectionsTest.java
##########
@@ -918,4 +922,111 @@ public void testInMarkerWithUDTs() throws Throwable
                                  "UPDATE %s SET v = {a: 0, b: 'bc'} WHERE k = 0 IF v.a IN ?", unset());
         }
     }
+
+    @Test
+    public void testNonFrozenEmptyCollection() throws Throwable

Review comment:
       Is there a reason for not checking also frozen collections?

##########
File path: test/unit/org/apache/cassandra/cql3/conditions/ColumnConditionTest.java
##########
@@ -136,6 +136,22 @@ private static boolean conditionApplies(List<ByteBuffer> rowValue, Operator op,
         return bound.appliesTo(newRow(definition, rowValue));
     }
 
+    private static boolean conditionContainsApplies(List<ByteBuffer> rowValue, Operator op, ByteBuffer conditionValue)
+    {
+        ColumnMetadata definition = ColumnMetadata.regularColumn("ks", "cf", "c", ListType.getInstance(Int32Type.instance, true));

Review comment:
       Note to myself: the guy that created this test class did not do a really good job. He forgot to test for non-frozen collections.

##########
File path: src/java/org/apache/cassandra/cql3/conditions/ColumnCondition.java
##########
@@ -573,6 +576,38 @@ private static boolean mapAppliesTo(MapType<?, ?> type, Iterator<Cell<?>> iter,
         }
     }
 
+    private static boolean containsAppliesTo(CollectionType<?> type, Iterator<Cell<?>> iter, ByteBuffer value, Operator operator){

Review comment:
       Nit: the brace should be on the next line. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org