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


##########
src/java/org/apache/cassandra/index/sai/plan/StorageAttachedIndexQueryPlan.java:
##########
@@ -71,18 +75,24 @@ public static StorageAttachedIndexQueryPlan 
create(ColumnFamilyStore cfs,
 
         for (RowFilter.Expression expression : rowFilter)
         {
-            // we ignore any expressions here (currently IN and user-defined 
expressions) where we don't have a way to
-            // translate their #isSatifiedBy method, they will be included in 
the filter returned by QueryPlan#postIndexQueryFilter()
+            // We ignore any expressions here (currently IN and user-defined 
expressions) where we don't have a way to
+            // translate their #isSatifiedBy method, they will be included in 
the filter returned by 
+            // QueryPlan#postIndexQueryFilter(). If strict filtering is not 
allowed, we must reject the query until the
+            // expression(s) in question are compatible with #isSatifiedBy.
             //
             // Note: For both the pre- and post-filters we need to check that 
the expression exists before removing it
             // because the without method assert if the expression doesn't 
exist. This can be the case if we are given
             // a duplicate expression - a = 1 and a = 1. The without method 
removes all instances of the expression.
             if (expression.operator().isIN() || expression.isUserDefined())
             {
+                if (!rowFilter.isStrict())
+                    throw new 
InvalidRequestException(String.format(UNSUPPORTED_NON_STRICT_OPERATOR, 
expression.operator()));

Review Comment:
   Yes, makes sense. Since we build the query plan when creating the command, 
`Index#validate(ReadCommand)` has lost part of its sense.



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