optimise pruning of aggs

optimise pruning of aggregators for topN
This commit is contained in:
nishantmonu51 2014-11-19 00:17:25 +05:30
parent 00806ba836
commit 6023d602e6
1 changed files with 2 additions and 1 deletions

View File

@ -156,6 +156,7 @@ public class TopNQueryQueryToolChest extends QueryToolChest<Result<TopNResultVal
return new Function<Result<TopNResultValue>, Result<TopNResultValue>>()
{
private String dimension = query.getDimensionSpec().getOutputName();
final List<PostAggregator> prunedAggs = prunePostAggregators(query);
@Override
public Result<TopNResultValue> apply(Result<TopNResultValue> result)
@ -172,7 +173,7 @@ public class TopNQueryQueryToolChest extends QueryToolChest<Result<TopNResultVal
for (AggregatorFactory agg : query.getAggregatorSpecs()) {
values.put(agg.getName(), fn.manipulate(agg, input.getMetric(agg.getName())));
}
for (PostAggregator postAgg : prunePostAggregators(query)) {
for (PostAggregator postAgg : prunedAggs) {
Object calculatedPostAgg = input.getMetric(postAgg.getName());
if (calculatedPostAgg != null) {
values.put(postAgg.getName(), calculatedPostAgg);