-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Extensible design to add new query and field type support for Star Tree #17137
Conversation
@msfroh @bharath-techie Kindly help with the review. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #17137 +/- ##
=============================================
- Coverage 72.35% 0 -72.36%
=============================================
Files 5298 0 -5298
Lines 304603 0 -304603
Branches 44187 0 -44187
=============================================
- Hits 220397 0 -220397
+ Misses 66095 0 -66095
+ Partials 18111 0 -18111 ☔ View full report in Codecov by Sentry. |
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.
Overall, there's a lot of really nice refactoring in this PR. Of course, whenever you clean up some stuff, it highlights some of the mess in what's left. A lot of my comments are around things that could be even cleaner.
Also, for your two providers (StarTreeFilterProvider
and DimensionFilterMapper
), I believe that String
keys are more consistent with existing pluggable interfaces.
...h/index/compositeindex/datacube/startree/utils/iterator/SortedSetStarTreeValuesIterator.java
Outdated
Show resolved
Hide resolved
...r/src/main/java/org/opensearch/index/compositeindex/datacube/startree/node/StarTreeNode.java
Show resolved
Hide resolved
server/src/main/java/org/opensearch/search/startree/StarTreeQueryContext.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/search/startree/StarTreeQueryHelper.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/search/startree/StarTreeQueryHelper.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/search/startree/StarTreeQueryHelper.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/search/startree/StarTreeQueryHelper.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/search/startree/filter/provider/StarTreeFilterProvider.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/search/startree/filter/provider/DimensionFilterMapper.java
Outdated
Show resolved
Hide resolved
❌ Gradle check result for 775330e: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: expani <[email protected]>
Signed-off-by: expani <[email protected]>
Signed-off-by: expani <[email protected]>
❌ Gradle check result for 204a107: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for c177a3f: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Flaky UNRELATED test passing locally trying with closing and reopening PR again. |
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-17137-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 b9ddef9c9749e02deeccf95946b60b2303bbfd9c
# Push it to GitHub
git push --set-upstream origin backport/backport-17137-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x Then, create a pull request where the |
…ee (opensearch-project#17137) --------- Signed-off-by: expani <[email protected]>
…ort for Star Tree (#17173) * Extensible design to add new query and field type support for Star Tree (#17137) --------- Signed-off-by: expani <[email protected]> * Merge conflict resolution for Java11 Signed-off-by: expani <[email protected]> * Added back StarTreeQryCtx methods in SearchCtx to make API Compatibility pass Signed-off-by: expani <[email protected]> * Java11 Compatible changes Signed-off-by: expani <[email protected]> --------- Signed-off-by: expani <[email protected]>
…ee (opensearch-project#17137) --------- Signed-off-by: expani <[email protected]> Signed-off-by: Eugene Tolbakov <[email protected]>
Description
This PR introduces constructs to help convert user queries into the equivalent star tree traversal by generating the appropriate
DimensionFilter
based on the type of query.DimensionFilterMapper
acts as an equivalent mapper for Star Tree supported fields and queries.StarTreeFilterProvider
is responsible for converting the user queries ( represented by QueryBuilder )I have changed all the older tests to point towards the new classes to ensure that we get coverage for at least numeric term queries.
We have tested term, terms and range queries on numeric and keyword over http_logs for sanity of the code and fixed some tricky bugs on different cases. Thanks to @bharath-techie for help with creating end to end query test with randomness.
I will be adding Unit tests for Range and other new classes that are not covered by existing tests in the coming days.
Most of the TODO left around the code will be picked up in future when supporting Filter Aggregations and Boolean queries. If that's not the case, please comment on the same.
Related Issues
#16537
#16538
#16539
NOTE
I had to close the older PR due to it becoming very hard to recover after a rebase gone wrong. Apologies to the reviewers for the inconvenience caused.