Skip to content

Add segment pruning based on secondary partition dimension#2982

Merged
fjy merged 9 commits intoapache:masterfrom
acslk:feature-prun
Jun 24, 2016
Merged

Add segment pruning based on secondary partition dimension#2982
fjy merged 9 commits intoapache:masterfrom
acslk:feature-prun

Conversation

@acslk
Copy link
Copy Markdown
Contributor

@acslk acslk commented May 18, 2016

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.

@fjy fjy added this to the 0.9.2 milestone May 18, 2016
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion : change return type to Optional since not all queries have filters.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@fjy
Copy link
Copy Markdown
Contributor

fjy commented Jun 22, 2016

@acslk there are merge conflicts

@fjy fjy closed this Jun 23, 2016
@fjy fjy reopened this Jun 23, 2016
@fjy
Copy link
Copy Markdown
Contributor

fjy commented Jun 23, 2016

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants