Repository navigation
ESQL: Fix NULL handling in IN clause - #125832
Merged
bpintea merged 10 commits intoApr 11, 2025
Merged
Conversation
Collaborator
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
idegtiarenko
approved these changes
Apr 8, 2025
Contributor
Author
|
Thanks for review @idegtiarenko! I believe you should manually ping buildkite for a CI test since this PR is submitted by an external contributor. |
Contributor
|
buildkite test this |
Contributor
Author
|
I forgot to add a new capability for the csv test, now it has been included in 2fd4e60. |
bpintea
approved these changes
Apr 11, 2025
bpintea
left a comment
Contributor
There was a problem hiding this comment.
LGTM, added minor notes only. 🙏
| required_capability: filter_in_converted_null | ||
| FROM employees | ||
| | WHERE emp_no in (10021, 10022, null::int) | ||
| | KEEP emp_no, first_name, last_name |
Contributor
There was a problem hiding this comment.
Could we add a trailing SORT on emp_no? The results might get rearranged otherwise and fail the test.
| In in = new In( | ||
| EMPTY, | ||
| new FieldAttribute(Source.EMPTY, "field", new EsField("suffix", DataType.KEYWORD, Map.of(), true)), | ||
| Arrays.asList(ONE, new Literal(Source.EMPTY, null, DataType.INTEGER), THREE) |
Contributor
There was a problem hiding this comment.
Could we randomise the data type here?
Contributor
Author
Contributor
|
buildkite test this |
Contributor
|
Thanks, @kanoshiou! |
nik9000
pushed a commit
to nik9000/elasticsearch
that referenced
this pull request
May 1, 2025
This PR fixes elastic#119950 where an `IN` query includes `NULL` values with non-NULL `DataType` appearing within the query range. An expression is considered `NULL` when its `DataType` is `NULL` or it is a `Literal` with a value of `null`.
nik9000
added a commit
that referenced
this pull request
May 1, 2025
* ESQL: Allow the data type of `null` in filters (#118324) * Allow the data type of `null` in filters * ESQL: Fix `NULL` handling in `IN` clause (#125832) This PR fixes #119950 where an `IN` query includes `NULL` values with non-NULL `DataType` appearing within the query range. An expression is considered `NULL` when its `DataType` is `NULL` or it is a `Literal` with a value of `null`. * Revert formatting --------- Co-authored-by: kanoshiou <73424326+kanoshiou@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes #119950 where an
INquery includesNULLvalues with non-NULLDataTypeappearing within the query range. An expression is consideredNULLwhen itsDataTypeisNULLor it is aLiteralwith a value ofnull.