You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the sample above user is a nested field in the test index. There are null values for user.last in the documents.
For the following query, there are no results:
sql> select *, user.* from test where "user.last" is null;
groupName | user.first | user.last
---------------+---------------+---------------
sql>
The problem lies in the way the ES query is constructed. When something is null (or doesn't exist) in ES terminology, the "negated" exists query is used. At the moment, ES SQL translates the query above in the following ES query (some bits were removed as not relevant and to increase readability):
The relevant bit is that the nested query should include the bool must_not, while the current version of ES SQL puts the nested query inside the bool must_not.
The text was updated successfully, but these errors were encountered:
Add `IsNull` node in parser to simplify expressions so that `<value> IS NULL` is
no longer translated internally to `NOT(<value> IS NOT NULL)`
Replace `IsNotNullProcessor` with `CheckNullProcessor` to encapsulate both
isNull and isNotNull functionality.
Closes: #34876Fixes: #35171
Add `IsNull` node in parser to simplify expressions so that `<value> IS NULL` is
no longer translated internally to `NOT(<value> IS NOT NULL)`
Replace `IsNotNullProcessor` with `CheckNullProcessor` to encapsulate both
isNull and isNotNull functionality.
Closes: #34876Fixes: #35171
In the sample above
user
is anested
field in thetest
index. There arenull
values foruser.last
in the documents.For the following query, there are no results:
The problem lies in the way the ES query is constructed. When something
is null
(or doesn't exist) in ES terminology, the "negated"exists
query is used. At the moment, ES SQL translates the query above in the following ES query (some bits were removed as not relevant and to increase readability):While the query above is correct syntactically, it is incorrect for the
IS NULL
scenario. The correct query is:The relevant bit is that the
nested
query should include thebool must_not
, while the current version of ES SQL puts thenested
query inside thebool must_not
.The text was updated successfully, but these errors were encountered: