Skip to content

[ES|QL] FUSE command fails when a column contains NULL #137544

@jimczi

Description

@jimczi

If a column is NULL, FUSE fails with:

{
    "error": {
        "root_cause": [
            {
                "type": "esql_illegal_argument_exception",
                "reason": "illegal data type [null]"
            }
        ],
        "type": "esql_illegal_argument_exception",
        "reason": "illegal data type [null]"
    },
    "status": 500
}

Reproduction:

POST my-index/_doc
{
    "id": "park_rocky-mountain",
    "title": "Rocky Mountain",
    "description": "Bisected north to south by the Continental Divide, this portion of the Rockies has ecosystems varying from over 150 riparian lakes to montane and subalpine forests to treeless alpine tundra."
}

POST _query?format=txt
{
  "query": """
FROM my-index METADATA _id, _index, _score | 
EVAL input = null | 
EVAL tm = CASE(input is NULL, \"\", input) | WHERE tm==\"\" OR MATCH(title, tm) | 
FORK 
  (WHERE title:\"rocky\" | SORT _score DESC)
  (WHERE description:\"rocky\" | SORT _score DESC) | 
FUSE | 
LIMIT 10
"""
}

Dropping the NULL column before FUSE solves the issue:

POST _query?format=txt
{
  "query": """
FROM my-index METADATA _id, _index, _score | 
EVAL input = null | 
EVAL tm = CASE(input is NULL, \"\", input) | WHERE tm==\"\" OR MATCH(title, tm) | 
FORK 
  (WHERE title:\"rocky\" | SORT _score DESC)
  (WHERE description:\"rocky\" | SORT _score DESC) | 
DROP input
FUSE | 
LIMIT 10
"""
}

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