Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG][PPL] NPE when running head 10 | stats count() by span(timestamp, 1h) #3182

Closed
joshuali925 opened this issue Dec 2, 2024 · 1 comment
Labels
bug Something isn't working untriaged

Comments

@joshuali925
Copy link
Member

What is the bug?
Getting NPE when calling stats with span

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

  1. create test index
POST /test/_doc
{
  "observedTime": "2024-12-02T21:19:50Z"
}
  1. run query to see error
POST /_plugins/_ppl
{
  "query": "source = test | head 10 | stats count() by span(observedTime, 1h)"
}
{
  "error": {
    "reason": "Invalid Query",
    "details": "Cannot invoke \"java.lang.Comparable.compareTo(Object)\" because \"k1\" is null",
    "type": "NullPointerException"
  },
  "status": 400
}

Note that without head 10 it works correctly, maybe some issue with span when running in memory?

What is the expected behavior?
should not have NPE and should return results correctly

{
  "schema": [
    {
      "name": "count()",
      "type": "integer"
    },
    {
      "name": "span(observedTime,1h)",
      "type": "timestamp"
    }
  ],
  "datarows": [
    [
      1,
      "2024-12-02 21:00:00"
    ]
  ],
  "total": 1,
  "size": 1
}

What is your host/environment?

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

Do you have any screenshots?
If applicable, add screenshots to help explain your problem.

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

@joshuali925
Copy link
Member Author

Took a look, it's already fixed by #3079

This was working in 2.15, not working in 2.17/2.18, and should be working again in 2.19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged
Projects
None yet
Development

No branches or pull requests

1 participant