What is the bug?
In PPL WHERE clauses, most plain boolean expressions are failing. Two related repros below:
How can one reproduce the bug?
- Create a test index (here
test_19a673e2) with at least two fields of type boolean (here x and y).
- First example: try to just select rows where
x is truthy:
POST _plugins/_ppl
{
"query": "SOURCE = test_19a673e2 | WHERE x"
}
Result:
{
"error": {
"reason": "Invalid Query",
"details": "Failed to parse query due to offending symbol [<EOF>] at: 'SOURCE = test_19a673e2 | WHERE x' <--- HERE... More details: Expecting tokens in {'SEARCH', 'DESCRIBE', ..., BQUOTA_STRING}",
"type": "SyntaxCheckException"
},
"status": 400
}
- Second example: forget boolean variables, just select all the rows with a no-op
WHERE:
POST _plugins/_ppl
{
"query": "SOURCE = test_19a673e2 | WHERE TRUE"
}
Result:
{
"error": {
"reason": "Invalid Query",
"details": "Failed to parse query due to offending symbol [<EOF>] at: 'SOURCE = test_19a673e2 | WHERE TRUE' <--- HERE... More details: Expecting tokens in {'SEARCH', 'DESCRIBE', ..., BQUOTA_STRING}",
"type": "SyntaxCheckException"
},
"status": 400
}
- Third example: the first example can be resolved by using
x = TRUE instead of just x, but now let's try combining variables:
POST _plugins/_ppl
{
"query": "SOURCE = test_19a673e2 | WHERE x OR y"
}
Result:
{
"error": {
"reason": "Invalid Query",
"details": "Failed to parse query due to offending symbol [OR] at: 'SOURCE = test_19a673e2 | WHERE x OR' <--- HERE... More details: Expecting tokens in {'SEARCH', 'DESCRIBE', ..., BQUOTA_STRING}",
"type": "SyntaxCheckException"
},
"status": 400
}
What is the expected behavior?
Logical expressions involving boolean variables should behave as expected.
What is your host/environment?
Do you have any screenshots?
N/A
Do you have any additional context?
Found by distributed-testing.
What is the bug?
In PPL WHERE clauses, most plain boolean expressions are failing. Two related repros below:
How can one reproduce the bug?
test_19a673e2) with at least two fields of typeboolean(herexandy).xis truthy:Result:
{ "error": { "reason": "Invalid Query", "details": "Failed to parse query due to offending symbol [<EOF>] at: 'SOURCE = test_19a673e2 | WHERE x' <--- HERE... More details: Expecting tokens in {'SEARCH', 'DESCRIBE', ..., BQUOTA_STRING}", "type": "SyntaxCheckException" }, "status": 400 }WHERE:Result:
{ "error": { "reason": "Invalid Query", "details": "Failed to parse query due to offending symbol [<EOF>] at: 'SOURCE = test_19a673e2 | WHERE TRUE' <--- HERE... More details: Expecting tokens in {'SEARCH', 'DESCRIBE', ..., BQUOTA_STRING}", "type": "SyntaxCheckException" }, "status": 400 }x = TRUEinstead of justx, but now let's try combining variables:Result:
{ "error": { "reason": "Invalid Query", "details": "Failed to parse query due to offending symbol [OR] at: 'SOURCE = test_19a673e2 | WHERE x OR' <--- HERE... More details: Expecting tokens in {'SEARCH', 'DESCRIBE', ..., BQUOTA_STRING}", "type": "SyntaxCheckException" }, "status": 400 }What is the expected behavior?
Logical expressions involving boolean variables should behave as expected.
What is your host/environment?
Do you have any screenshots?
N/A
Do you have any additional context?
Found by distributed-testing.