pranavshenoy commented on code in PR #4290:
URL: https://github.com/apache/cassandra/pull/4290#discussion_r2337150404


##########
src/java/org/apache/cassandra/cql3/restrictions/SimpleRestriction.java:
##########
@@ -345,11 +352,14 @@ public void addToRowFilter(RowFilter filter, 
IndexRegistry indexRegistry, QueryO
                 else if (operator == Operator.LIKE)
                 {
                     LikePattern pattern = LikePattern.parse(buffers.get(0));
-                    // there must be a suitable INDEX for LIKE_XXX expressions
+                    
                     RowFilter.SimpleExpression expression = filter.add(column, 
pattern.kind().operator(), pattern.value());
-                    indexRegistry.getBestIndexFor(expression, indexHints)
-                                 .orElseThrow(() -> invalidRequest("%s is only 
supported on properly indexed columns",
-                                                                   
expression));
+                    Optional<Index> index = 
indexRegistry.getBestIndexFor(expression, indexHints);
+                    if(!index.isPresent() && !allowFiltering)
+                    {
+                        throw invalidRequest("%s is only supported on properly 
indexed columns or with ALLOW FILTERING",
+                                            expression);
+                    }

Review Comment:
   done



##########
src/java/org/apache/cassandra/cql3/Ordering.java:
##########
@@ -105,7 +105,7 @@ public SingleRestriction toRestriction()
         {
             return new 
SimpleRestriction(ColumnsExpression.singleColumn(columnMetadata, tableMetadata),
                                          Operator.ANN,
-                                         Terms.of(vectorValue));
+                                         Terms.of(vectorValue), false);

Review Comment:
   done



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