Skip to content

esql_async doesn't remember drop_null_columns setting during poll #138439

@drewdaemon

Description

@drewdaemon

Description

Start with the initial request, including drop_null_columns (notice that foo is a null column):

Request

curl -X POST "http://localhost:9200/_query/async?drop_null_columns" \
  -u "elastic:changeme"  -H "Content-Type: application/json" \
  -d '{
    "query": "ROW foo = NULL, bar = 1 | EVAL DELAY(1s)",
    "keep_alive": "5m",
    "wait_for_completion_timeout": "1s"
  }'

Response

{
  "id": "FlNHRGc5VjJtVGFhRHhUZG43a0NtVkEaVVI3Y181VmFRV1dJeE5wMjZac3RSUTo1NjQ=",
  "is_running": true,
  "documents_found": 0,
  "values_loaded": 0,
  "all_columns": [],
  "columns": [],
  "values": []
}

Then, fetch the result:

Request

curl "http://localhost:9200/_query/async/FlNHRGc5VjJtVGFhRHhUZG43a0NtVkEaVVI3Y181VmFRV1dJeE5wMjZac3RSUTo1NjQ=" -u "elastic:changeme"

Response

{
  "is_running": false,
  "took": 1011,
  "is_partial": false,
  "documents_found": 0,
  "values_loaded": 0,
  "columns": [
    {
      "name": "foo",
      "type": "null"
    },
    {
      "name": "bar",
      "type": "integer"
    },
    {
      "name": "DELAY(1s)",
      "type": "boolean"
    }
  ],
  "values": [
    [
      null,
      1,
      true
    ]
  ]
}

The original drop_null_columns setting isn't remembered, so foo is included in the columns property and there is no all_columns property.

This surprised me, and changing it would allow us (Kibana) to simplify our polling logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions