Repository navigation
ESQL: Fix LIMIT NPE with null value - #130914
Merged
Merged
Conversation
Collaborator
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
Collaborator
|
Hi @ivancea, I've created a changelog YAML for you. |
luigidellaquila
approved these changes
Jul 9, 2025
luigidellaquila
left a comment
Member
There was a problem hiding this comment.
LGTM, thanks @ivancea !
ivancea
enabled auto-merge (squash)
July 9, 2025 12:35
astefan
reviewed
Jul 9, 2025
astefan
left a comment
Contributor
There was a problem hiding this comment.
Nice catch!
I have a suggested a slightly different approach with the error message. The difference is that LIMIT NuLL and LIMIT null and LIMIT nuLL will each have a different error message which uses the exact text that was used in the query.
The PR in its current form will always create an error message Invalid value for LIMIT [null] no matter if the query used null, NuLL or nuLL.
Comment on lines
+401
to
+402
| } else if (val == null) { | ||
| throw new ParsingException(source, "Invalid value for LIMIT [null], expecting a non negative integer"); |
Contributor
There was a problem hiding this comment.
Suggested change
| } else if (val == null) { | |
| throw new ParsingException(source, "Invalid value for LIMIT [null], expecting a non negative integer"); | |
| } else { | |
| String valueAsString; | |
| if (val == null) { | |
| valueAsString = ctx.constant().getText(); | |
| } else { | |
| valueAsString = BytesRefs.toString(val) | |
| + ": " | |
| + (expression(ctx.constant()).dataType() == KEYWORD ? "String" : val.getClass().getSimpleName()); | |
| } | |
| throw new ParsingException(source, "Invalid value for LIMIT [" + valueAsString + "], expecting a non negative integer"); | |
| } |
ivancea
disabled auto-merge
July 9, 2025 13:12
astefan
approved these changes
Jul 9, 2025
nik9000
approved these changes
Jul 9, 2025
ivancea
enabled auto-merge (squash)
July 10, 2025 09:08
# Conflicts: # x-pack/plugin/build.gradle # x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/ParsingTests.java
Collaborator
💔 Backport failed
You can use sqren/backport to manually backport by running |
ivancea
added a commit
to ivancea/elasticsearch
that referenced
this pull request
Jul 10, 2025
This was referenced Jul 10, 2025
ivancea
added a commit
to ivancea/elasticsearch
that referenced
this pull request
Jul 10, 2025
ivancea
added a commit
that referenced
this pull request
Jul 11, 2025
ivancea
added a commit
that referenced
this pull request
Jul 11, 2025
mridula-s109
pushed a commit
to mridula-s109/elasticsearch
that referenced
this pull request
Jul 17, 2025
mridula-s109
pushed a commit
to mridula-s109/elasticsearch
that referenced
this pull request
Jul 17, 2025
verawu
pushed a commit
to verawu/elasticsearch
that referenced
this pull request
Jul 21, 2026
Manual 8.19 backport of elastic/elasticsearch#130914
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.
Fixes #130908