maedhroz commented on code in PR #2935:
URL: https://github.com/apache/cassandra/pull/2935#discussion_r1496381621
##########
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:
I went back and forth on this a bit. It certainly could be thrown there, but
here we have both the scaffolding for iterating over the expressions and the
logic for what happens when all is well and the filter is in strict mode. It
seemed easier to be able to see those things in one place. WDYT?
--
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]