Skip to content

allow queries with filtered aggs to match unfiltered projection aggs as long as the filter required columns are present#18535

Merged
clintropolis merged 2 commits intoapache:masterfrom
clintropolis:projection-filtered-aggs
Sep 18, 2025
Merged

allow queries with filtered aggs to match unfiltered projection aggs as long as the filter required columns are present#18535
clintropolis merged 2 commits intoapache:masterfrom
clintropolis:projection-filtered-aggs

Conversation

@clintropolis
Copy link
Copy Markdown
Member

Description

Queries with filtered aggregators can use projections which have unfiltered versions of those same aggs as long as the projection also has the columns present to be able to satisfy evaluating the filter.

…as long as the filter required columns are present
}
boolean allMatch = true;
for (AggregatorFactory queryAgg : queryCursorBuildSpec.getAggregators()) {
AggregatorFactory filterAgg = null;
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.

nit: maybe can move FilteredAggregatorFactory filteredQueryAgg up here and check null for that instead

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it needs to go after the check for exact aggregator match because we would prefer an exact match in case the projection itself defined a filtered aggregator, so this is a fallback to see if a query filtered aggregator can use a non-filtered agg

@clintropolis clintropolis merged commit 2a2b65d into apache:master Sep 18, 2025
62 checks passed
@clintropolis clintropolis deleted the projection-filtered-aggs branch September 18, 2025 23:17
@cecemei cecemei added this to the 35.0.0 milestone Oct 21, 2025
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.

2 participants