Skip to content

Commit

Permalink
Remove subaggregator check from CompositeAggregator
Browse files Browse the repository at this point in the history
Not sure why I added this, when the existing implementation didn't have it.

That said, we *should* call finishLeaf() before precomputing the current leaf.

Signed-off-by: Michael Froh <froh@amazon.com>
  • Loading branch information
msfroh committed Jan 25, 2025
1 parent 37f02df commit c3897a0
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -557,10 +557,8 @@ private void processLeafFromQuery(LeafReaderContext ctx, Sort indexSortPrefix) t

@Override
protected boolean tryPrecomputeAggregationForLeaf(LeafReaderContext ctx) throws IOException {
if (subAggregators().length == 0) {
return filterRewriteOptimizationContext.tryOptimize(ctx, this::incrementBucketDocCount, segmentMatchAll(context, ctx));
}
return false;
finishLeaf(); // May need to wrap up previous leaf if it could not be precomputed
return filterRewriteOptimizationContext.tryOptimize(ctx, this::incrementBucketDocCount, segmentMatchAll(context, ctx));
}

@Override
Expand Down

0 comments on commit c3897a0

Please sign in to comment.