opensearch-project / opensearch-project/sql
[BUG] eventstats/streamstats reject window functions that grammar accepts
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 176
- Forks
- 229
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 43
Description
Query Information
PPL Command/Query:
source=bounty-types | eventstats row_number() by str_field
source=bounty-types | streamstats rank() by int_field
source=bounty-types | eventstats dense_rank() by str_field
Expected Result:
Supported window functions should execute in eventstats/streamstats.
Actual Result:
Each query fails with HTTP 500 and Unexpected window function for row_number, rank, and dense_rank.
Dataset Information
Dataset/Schema Type
- OpenTelemetry (OTEL)
- Simple Schema for Observability (SS4O)
- Open Cybersecurity Schema Framework (OCSF)
- Custom (details below)
Index Mapping
{
"mappings": {
"properties": {
"int_field": { "type": "integer" },
"str_field": { "type": "keyword" }
}
}
}
Sample Data
[
{ "int_field": 42, "str_field": "alpha" },
{ "int_field": -1, "str_field": "alpha" },
{ "int_field": 0, "str_field": "beta" }
]
Bug Description
Issue Summary:
eventstats/streamstats rejects common window functions even though grammar accepts them.
Steps to Reproduce:
- Create index with
int_fieldandstr_field. - Insert sample rows.
- Run each query above.
- Observe HTTP 500
Unexpected window functionerrors.
Impact:
Window-based analytics pipelines cannot run using these standard functions.
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 reproducing the three PPL queries against the sample mapping and data, then trace the eventstats/streamstats handling that emits Unexpected window function. Done means row_number(), rank(), and dense_rank() execute successfully in both commands without HTTP 500 errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100