Skip to content

Commit

Permalink
add back isMultiExpression
Browse files Browse the repository at this point in the history
  • Loading branch information
jbellis committed Dec 2, 2024
1 parent 9ec4c6a commit 087b14f
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion src/java/org/apache/cassandra/index/sai/plan/Operation.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,32 @@ protected static ListMultimap<ColumnMetadata, Expression> analyzeGroup(QueryCont
// if there is no EQ operations and NOT_EQ is met or a single NOT_EQ expression present,
// in such case we know exactly that there would be no more EQ/RANGE expressions for given column
// since NOT_EQ has the lowest priority.
boolean isMultiExpression = false;
boolean isMultiExpression = columnIsMultiExpression.getOrDefault(e.column(), Boolean.FALSE);
switch (e.operator())
{
// case BM25: leave it at the default of `false`
case EQ:
// EQ operator will always be a multiple expression because it is being used by map entries
isMultiExpression = indexContext.isNonFrozenCollection();

// EQ wil behave like ANALYZER_MATCHES for analyzed columns if the analyzer supports EQ queries
isMultiExpression |= indexContext.isAnalyzed() && analyzerFactory.supportsEquals();
break;
case CONTAINS:
case CONTAINS_KEY:
case NOT_CONTAINS:
case NOT_CONTAINS_KEY:
case LIKE_PREFIX:
case LIKE_MATCHES:
case ANALYZER_MATCHES:
isMultiExpression = true;
break;
case NEQ:
// NEQ operator will always be a multiple expression if it is the only operator
// (e.g. multiple NEQ expressions)
isMultiExpression = isMultiExpression || perColumn.isEmpty();
break;
}
columnIsMultiExpression.put(e.column(), isMultiExpression);

if (isMultiExpression)
Expand Down

0 comments on commit 087b14f

Please sign in to comment.