Skip to content

[BUG] Some complex use cases of streamstats failed after "Bump Calcite to 1.41.0" #4800

Closed

Description

@ishaoxy

What is the bug?
The version of Calcite was updated to 1.41.0 in #4714 .
Streamstats command was implemented in #4297 .

These complex use cases worked in the former version of Calcite, but now failed.

  "query": """
  source=stream_test_null | streamstats window=2 avg(age) as avg_age by state, country | streamstats window=2 avg(avg_age) as avg_state_age by country
  """
POST _plugins/_ppl
{
  "query": """
  source=stream_test_null | streamstats reset_before=age>20 avg(age) as avg_age | streamstats reset_before=avg_age>20 window=2 avg(avg_age) as avg_state_age by country
  """
}
POST _plugins/_ppl
{
  "query": """
  source=stream_test_null | streamstats reset_before=age>22 avg(age) as avg_age  | streamstats window=2 avg(avg_age) as avg_state_age by country
  """

It is caused by a NPE. But I still not find the exact reason in the Calcite code.

How can one reproduce the bug?
Steps to reproduce the behavior:

Set data:

POST stream_test_null/_bulk?refresh=true
{"index":{"_id":"1"}}
{"name":"Jake","age":70,"state":"California","country":"USA","year":2023,"month":4}
{"index":{"_id":"2"}}
{"name":"Hello","age":30,"state":"New York","country":"USA","year":2023,"month":4}
{"index":{"_id":"3"}}
{"name":"John","age":25,"state":"Ontario","country":"Canada","year":2023,"month":4}
{"index":{"_id":"4"}}
{"name":"Jane","age":20,"state":"Quebec","country":"Canada","year":2023,"month":4}
{"index":{"_id":"5"}}
{"name":null,"age":10,"state":null,"country":"Canada","year":2023,"month":4}
{"index":{"_id":"6"}}
{"name":"Kevin","year":2023,"month":4}

Then do the query.

What is the expected behavior?
A clear and concise description of what you expected to happen.

What is your host/environment?

  • OS: [e.g. iOS]
  • Version [e.g. 22]
  • Plugins

Do you have any screenshots?

Do you have any additional context?
Add any other context about the problem.

Activity

  1. added
    bug
    on Nov 13, 2025
  2. added
    PPL
    and removed on Nov 14, 2025
  3. self-assigned this
    on Jan 5, 2026
  4. moved this from Not Started to Done in PPL Trackeron Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

PPLbug

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions