-
Notifications
You must be signed in to change notification settings - Fork 25k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ES|QL] where null
throws VerificationException
when it is not under an aggregation
#116351
Comments
Pinging @elastic/es-analytical-engine (Team:Analytics) |
Hi @fang-xing-esql 👋 May I take on this issue? I would be very grateful for the opportunity. |
What is the actual desired outcome of |
I would assume a |
I think the discussion here is more subtle. All these three queries return the value
The first two queries return an exception, the last one succeeds and returns no rows and all columns. My previous question hinted at the difference between |
The example provided in the description hints at the value |
I think there's an inconsistency in the way we check the filters: the agg ones we allow a The command one only accepts BOOLEAN types (of whatever value). I think we should harmonise these. The way the proposed PR does seems OK if we accept the NULL type agg filters. Otherwise we should only accept BOOLEAN types (which seems more correct at first sight). |
I was having the wrong assumption. I've tested some queries and aggs do the right thing imo.
this results in |
The behavior of null filter is different when it is under or not under an aggregation.
Null filter is allowed under aggregation
However if a null filter is not under an aggregation,
VerificationException
is thrownBoth postgresql and mysql allow
where null
, it returns empty resultset and doesn't error out. We may want to havewhere null
behave the same when it is not under an aggregation.The text was updated successfully, but these errors were encountered: