Skip to content

ESQL: date_extract using a constant/literal chrono_field fails to record the warning #100038

@astefan

Description

@astefan

Description

For query from test | eval x = date_extract(pattern, date.date) | keep x where pattern is in the index set as y123ear (a non-existent ChronoField value) will return x as null in the results and have the response record two warnings in headers one of which is "java.lang.IllegalArgumentException: No enum constant java.time.temporal.ChronoField.Y123EAR"

But, if the same non-existent value y123ear is used as a constant ie from test | eval x = date_extract(\"y123year\", date.date) | keep x results in an error message and no warning recorded:

{
    "error": {
        "root_cause": [
            {
                "type": "esql_illegal_argument_exception",
                "reason": "invalid date field for [date_extract(\"y123year\", date.date)]: y123year",
                "suppressed": [
                    {
                        "type": "task_cancelled_exception",
                        "reason": "parent task was cancelled [cancelled]"
                    },
                    {
                        "type": "task_cancelled_exception",
                        "reason": "parent task was cancelled [cancelled]"
                    }
                ]
            }
        ],
        "type": "esql_illegal_argument_exception",
        "reason": "invalid date field for [date_extract(\"y123year\", date.date)]: y123year",
        "suppressed": [
            {
                "type": "task_cancelled_exception",
                "reason": "parent task was cancelled [cancelled]"
            },
            {
                "type": "task_cancelled_exception",
                "reason": "parent task was cancelled [cancelled]"
            }
        ]
    },
    "status": 500
}

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions