opensearch-project / opensearch-project/sql
[FEATURE] Pushdown any UDAF by scripted metric aggregations
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 176
- Forks
- 229
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 43
Description
Is your feature request related to a problem?
Currently, complex UDAFs like patterns command implement its own logic because OpenSearch core doesn't provide the corresponding aggregator implementation. For those UDAFs, it's not straightforward to pushdown aggregation by composite aggregation for them.
OpenSearch scripted metric aggregation provides a pipeline of multiple mapping to single reduce by multiple scripts. See: https://docs.opensearch.org/latest/aggregations/metric/scripted-metric/
DataNode1: initScript -> mapScript -> combineScript
\
\
DataNode2: initScript -> mapScript -> combineScript -> reduceScript -> agg result
/
/
DataNode3: initScript -> mapScript -> combineScript
What solution would you like?
A clear and concise description of what you want to happen.
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the OpenSearch scripted metric aggregation documentation and reviewing how the patterns command currently handles its complex UDAF logic. Compare that flow with composite aggregation pushdown and define the required behavior for init, map, combine, and reduce stages. Done means the feature has an agreed design and supports pushing down the intended UDAFs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100