-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Support for LIKE expressions as PostFilter in SAI #4290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
ad0a9e0
to
76e1487
Compare
Since LIKE is filtered in post filter, ALLOW FILTERING is required. I tested it with some basic queries. Will do further manual testing + unit tests. It would be helpful for early reviews. patch by Pranav Shenoy; reviewed by Caleb Rackliffe for CASSANDRA-17198
76e1487
to
35beebd
Compare
if (!restriction.hasSupportingIndex(indexRegistry)) | ||
throw invalidRequest("%s restriction is only supported on properly " + | ||
"indexed columns. %s is not valid.", operator, relation); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing this has been changed already in your not-yet-pushed work, but once LIKE doesn't return true
from requiresIndexing()
, seems like this change should no longer be necessary.
public static boolean matches(ByteBuffer buffer1, ByteBuffer buffer2) | ||
{ | ||
return buffer1.equals(buffer2); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I'd probably just inline this in Expression
rather than having a one-line utility method.
@@ -268,6 +287,10 @@ public boolean isSatisfiedBy(ByteBuffer columnValue) | |||
|
|||
if (lower != null) | |||
{ | |||
// Post-filtering for LIKE operators must be consistent with implementation of LIKE operators in non-SAI Allow Filtering path | |||
if(operator.isLikeVariant()) | |||
return termMatches(value.raw, lower.value.raw); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we still may need to account for things like case-insensitive search eventually, so we should be able to just fall through to validateStringValue()
, which would just call termMatches()
anyway?
CASSANDRA-17198 Support for LIKE expression as PostFilter in SAI
Since LIKE is filtered in post filter, ALLOW FILTERING is required. I tested it with some basic queries. Will do further manual testing + unit tests. It would be helpful for early reviews.
patch by Pranav Shenoy; reviewed by Caleb Rackliffe for CASSANDRA-17198