Skip to content

[BUG] COUNT with aggregation return multiple rows with null value #2716

@penghuo

Description

@penghuo

What is the bug?
curl --request POST
--url http://localhost:9200/_plugins/_sql?format=jdbc
--header 'content-type: application/json'
--data '{"query": "select count(*) from test00001 where status != 200"}'

the result include multiple rows

{
  "schema": [
    {
      "name": "count(*)",
      "type": "integer"
    }
  ],
  "datarows": [
    [
      10
    ],
    [
      null
    ],
    [
      null
    ],
    [
      null
    ],
    [
      null
    ],
    [
      null
    ],
    [
      null
    ],
    [
      null
    ],
    [
      null
    ],
    [
      null
    ]
  ],
  "total": 10,
  "size": 10,
  "

How can one reproduce the bug?
Todo

What is the expected behavior?
The result only include 1 rows

{
  "schema": [
    {
      "name": "count(*)",
      "type": "integer"
    }
  ],
  "datarows": [
    [
      10
    ]
  ],
  "total": 1,
  "size": 1,
  "

What is your host/environment?

  • OS: 2.11
  • Version [e.g. 22]
  • Plugins: SQL

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

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