Skip to content

[ES|QL] where null throws VerificationException when it is not under an aggregation #116351

@fang-xing-esql

Description

@fang-xing-esql

The behavior of null filter is different when it is under or not under an aggregation.

Null filter is allowed under aggregation

from employees
| stats max = max(salary), max_a = max(salary) where null,
        min = min(salary), min_a = min(salary) where to_string(null) == "abc"  
;

max:integer |max_a:integer|min:integer | min_a:integer
74999       |null         |25324       | null        
;

However if a null filter is not under an aggregation, VerificationException is thrown

{"query": "from sample_data | where null"}
{
  "error" : {
    "type" : "verification_exception",
    "reason" : "Found 1 problem\nline 1:26: Condition expression needs to be boolean, found [NULL]"
  },
  "status" : 400
}

Both postgresql and mysql allow where null, it returns empty resultset and doesn't error out. We may want to have where null behave the same when it is not under an aggregation.

Metadata

Metadata

Labels

:Analytics/ES|QLAKA ESQLTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions