Add segment pruning based on secondary partition dimension#2982
Merged
fjy merged 9 commits intoapache:masterfrom Jun 24, 2016
Merged
Add segment pruning based on secondary partition dimension#2982fjy merged 9 commits intoapache:masterfrom
fjy merged 9 commits intoapache:masterfrom
Conversation
Member
There was a problem hiding this comment.
suggestion : change return type to Optional since not all queries have filters.
Contributor
There was a problem hiding this comment.
IMO we have a long and proud history of null return for various Query things, and this is not the right PR to change those to Optional.
Also I'm not totally sure Guava Optional actually makes the code significantly better, it's missing stuff like foreach / ifPresent, map, and flatMap that make Scala Options and Java 8 Optionals really usable.
Contributor
|
@acslk there are merge conflicts |
Contributor
|
👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2940
Currently the CachingClusterClient, which is the queryRunner for broker node, puts all segments within the query interval into segment descriptors which is then retrieved from cache or other servers. This can be optimized by filtering out data segments with singleDimensionShardSpec that does not match the query filter. For instance, dataSegment with dimension "id" and value from "a" to "b" does not need to be retrieved for query with selection filter "id"="person".
This PR addresses this by calculating the range of possible values of the given dimension for the query filter, and intersect the range of filter with range of data segments to determine whether or not to add the segment to descriptors for retrieval.