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



##########
File path: src/java/org/apache/cassandra/cql3/conditions/ColumnCondition.java
##########
@@ -531,6 +534,25 @@ private static boolean setOrListAppliesTo(AbstractType<?> 
type, Iterator<Cell<?>
             return operator == Operator.EQ || operator == Operator.LTE || 
operator == Operator.GTE;
         }
 
+        private static boolean valueAppliesTo(Iterator<Cell<?>> iter, 
ByteBuffer value, boolean appliesToSetOrMapKeys)
+        {
+            while(iter.hasNext())
+            {
+                // for lists and map values we use the cell value; for sets 
and map keys we use the cell name
+                ByteBuffer cellValue = appliesToSetOrMapKeys ? 
iter.next().path().get(0) : iter.next().buffer();
+                int comparison = BytesType.instance.compare(cellValue, value);

Review comment:
       Thanks for your answer you clear some confusion and I see your point now 
:). I made some change to be consistant with a regular `type .compare()` 
instead of the raw BB comparison. 
   
   However I don't feel confortable to fallback on the 
`evaluateComparisonWithOperator()` because current call are performed `when 
comparison != 0`. It's fine for the existing operators but in this specific 
case of contains operators it seems pretty straight forward to check for `==0` 
because we don't want to iterate over the whole collection values (we will if 
the condition is not satisfied but otherwise as soon as match is found the 
condition is satisfied).




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to