opensearch-project / opensearch-project/sql

[FEATURE] Support pushdown `collect/array_agg` aggregation

Open
#5,070 0 comments 0 reactions 1 assignee View on GitHub

@LantaoJin is already working on this.

Since Jan 26, 2026.

enhancement PPL pushdown
Dominant language
Java
Stars
176
Forks
229
Avg merge
2d 21h
Merged PRs (30d)
43

Description

Is your feature request related to a problem?
https://github.com/opensearch-project/sql/pull/5025 introduces a new Calcite Aggregation COLLECT:
LogicalAggregate(group=[{0, 1}], age=[COLLECT($2) FILTER $3])
or
LogicalAggregate(group=[{0, 1}], packets_str=[ARRAY_AGG($2) FILTER $3])

Currently, PPL doesn't support pushdown a COLLECT aggregation to DSL, instead, it will be planned to EnumerableAggregate(group=[{0, 1}], age=[COLLECT($2) FILTER $3]).
or
EnumerableAggregate(group=[{0, 1}], packets_str=[ARRAY_AGG($2) FILTER $3])

What solution would you like?
Pushdown Aggregation COLLECT to TopHits aggregation.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.