Skip to content

[BUG] Get error when aggregations exceeds the number boundary withouth pushdown in calcite #3958

@xinyual

Description

@xinyual

What is the bug?
When use calcite without pushdown, aggregation will fail when exceeding the boundary.

How can one reproduce the bug?
Create an index like

PUT /tmp/
{
    "mappings": {
        "properties": {
            "demo": {
                "type": "short"
            }
        }
    }
}

and put two doc

POST /tmp/_doc/1
{
    "demo": 20000
}
POST /tmp/_doc/2
{
    "demo": 20000
}

Then put config like

PUT /_cluster/settings/
{
  "persistent" : {
    "plugins.calcite.enabled": true,
    "plugins.calcite.pushdown.enabled": false,
    "plugins.calcite.fallback.allowed": false
  }
}

We get error when call PPL

POST /_plugins/_ppl/
{
    "query": "source = tmp | stats sum(demo)"
}
{
  "error": {
    "reason": "There was internal problem at backend",
    "details": "java.sql.SQLException: exception while executing query: Value 40000 out of range",
    "type": "RuntimeException"
  },
  "status": 500
}

What is the expected behavior?
We can improve the precisions to allow the aggregation.

What is your host/environment?

  • OS: [e.g. iOS]
  • Version [e.g. 22]
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions