Skip to content

[BUG] PPL doesn't allow pure booleans in WHERE clauses #3273

Closed

Description

@Swiddis

What is the bug?
In PPL WHERE clauses, most plain boolean expressions are failing. Two related repros below:

How can one reproduce the bug?

  1. Create a test index (here test_19a673e2) with at least two fields of type boolean (here x and y).
  2. 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
}
  1. 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
}
  1. 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.

Activity

  1. added
    bug
    dynamic-test
    on Jan 29, 2025
  2. added
    PPL
    and removed on Jan 29, 2025
  3. self-assigned this
    on Jan 29, 2025
  4. Swiddis commented on Jan 29, 2025

    @Swiddis
    CollaboratorAuthor
  5. removed their assignment
    on May 27, 2025
  6. self-assigned this
    on Jun 27, 2025
  7. moved this from Not Started to In progress in PPL Trackeron Jul 8, 2025
  8. moved this from In progress to In review in PPL Trackeron Jul 8, 2025
  9. moved this from In review to Done in PPL Trackeron Jul 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

PPLbugdynamic-test

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions