-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: add support for utilising text indexes if exits for like operator in pinot based handlers #186
Conversation
Codecov Report
@@ Coverage Diff @@
## main #186 +/- ##
============================================
+ Coverage 78.68% 78.80% +0.11%
- Complexity 887 898 +11
============================================
Files 80 80
Lines 3626 3651 +25
Branches 413 419 +6
============================================
+ Hits 2853 2877 +24
Misses 598 598
- Partials 175 176 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
return REGEX_OPERATOR; | ||
} | ||
|
||
private Expression prefixValueForLikeOperator(String likeOperatorStr, Expression rhsExpression) { |
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.
For TEXT_MATCH regex query needs string to be prefixed and suffixed with '/'.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Expression rhs = | ||
handleValueConversionForLiteralExpression(filter.getLhs(), filter.getRhs()); | ||
rhs = postProcessValueConversionForLikeOperator(operator, rhs); |
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: rather than taking multiple steps to calculate the RHS in the top level, could you do something like
operator = handleLikeOperatorConversion(filter.getLhs());
Expression rhs =
handleValueConversionForLikeArgument(filter.getLhs(), filter.getRhs());
and then have handleValueConversionForLikeArgument
do the delegation.
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.
Done.
private Expression postProcessValueConversionForLikeOperator( | ||
String likeOperatorStr, Expression rhsExpression) { | ||
if (likeOperatorStr.equals(TEXT_MATCH_OPERATOR)) { | ||
String strValue = "/" + rhsExpression.getLiteral().getValue().getString() + "/"; |
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: this could be simplified a bit by just starting from the input.
Builder builder = rhsExpression.toBuilder()
if (condition) {
builder.getLiteralBuilder().getValueBuilder().setString(...);
}
return builder.build();
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.
Done.
Description
This PR add support for utilising text indexes for LIKE operator for pinot based request handler if the index for those column is enabled. So, the string column with index will translated to
Testing
Checklist: