Skip to content

[FEATURE] Push down bucket aggregation with sorting by metrics to multi-terms aggregation #4282

@LantaoJin

Description

@LantaoJin

Is your feature request related to a problem?
The query

| stats count() as cnt by a, b | sort cnt

will push down to a composite aggregation with 1000 buckets. So the sort by cnt only sorts on the 1000 records. The result is incorrect.

What solution would you like?
Push down such case to multi-terms aggregation https://docs.opensearch.org/latest/aggregations/bucket/multi-terms/

What alternatives have you considered?
A clear and concise description of any alternative solutions or features you've considered.

Do you have any additional context?
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestpushdownpushdown related issues

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions