maedhroz commented on code in PR #2935:
URL: https://github.com/apache/cassandra/pull/2935#discussion_r1463973799


##########
src/java/org/apache/cassandra/index/sai/plan/FilterTree.java:
##########
@@ -96,22 +100,56 @@ private boolean localSatisfiedBy(DecoratedKey key, 
Unfiltered unfiltered, Row st
                 if (filter.getIndexTermType().isNonFrozenCollection())
                 {
                     Iterator<ByteBuffer> valueIterator = 
filter.getIndexTermType().valuesOf(row, now);
-                    result = op.apply(result, collectionMatch(valueIterator, 
filter));
+                    result = localOperator.apply(result, 
collectionMatch(valueIterator, filter));
                 }
                 else
                 {
                     ByteBuffer value = filter.getIndexTermType().valueOf(key, 
row, now);
-                    result = op.apply(result, singletonMatch(value, filter));
+                    result = localOperator.apply(result, singletonMatch(value, 
filter));
                 }
 
                 // If the operation is an AND then exit early if we get a 
single false
-                if (op == BooleanOperator.AND && !result)
+                if (localOperator == BooleanOperator.AND && !result)
                     return false;
+
+                // If the operation is an OR then exit early if we get a 
single true
+                if (localOperator == BooleanOperator.OR && result)
+                    return true;
             }
         }
         return result;
     }
 
+    private BooleanOperator getLocalOperator(Row regularRow, Row staticRow)
+    {
+        // This is an AND query, but the coordinator has indicated strict 
filtering might not be allowed... 
+        if (baseOperator == BooleanOperator.AND && !strict)
+        {
+            Long lastTimestamp = null;
+            Iterator<ColumnMetadata> columns = expressions.keySet().iterator();
+
+            while (columns.hasNext())
+            {
+                ColumnMetadata column = columns.next();
+                Row row = column.kind == Kind.STATIC ? staticRow : regularRow;
+                ColumnData data = row.getColumnData(column);

Review Comment:
   That makes sense.
   
   `pk2_idx` should test elements of composite partition keys and `ck_idx` 
should hit clustering keys in `PartialUpdateHandlingTest`, IIRC



-- 
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