Closed
Description
SELECT LOCATE(CASE WHEN FALSE THEN NULL ELSE LEFT(first_name, 1) END, first_name) > 0 AS x FROM test_emp
fails with
{
"error" : {
"root_cause" : [
{
"type" : "illegal_argument_exception",
"reason" : "expected [3] children but received [2]"
}
],
"type" : "illegal_argument_exception",
"reason" : "expected [3] children but received [2]"
},
"status" : 400
}
No stack trace in logs...
Failed to simplify the failing test more than SELECT LOCATE(CASE WHEN FALSE THEN NULL ELSE 'x' END, first_name) > 0 AS x FROM test_emp
, it seems it really needs to have a CASE WHEN that goes on a FALSE
branch.