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
}
Description
For query
from test | eval x = date_extract(pattern, date.date) | keep xwherepatternis in the index set asy123ear(a non-existent ChronoField value) will returnxasnullin 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
y123earis used as a constant iefrom test | eval x = date_extract(\"y123year\", date.date) | keep xresults in an error message and no warning recorded: