-
Couldn't load subscription status.
- Fork 25.6k
ESQL: Fix case insensitive comparisons to "" #127532
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
55e144b
ESQL: Fix case insensitive comparisons to ""
nik9000 90cf77d
Update docs/changelog/127532.yaml
nik9000 b29e039
[CI] Auto commit changes from spotless
d7c6190
Merge branch 'main' into 127431
nik9000 a64d746
Merge remote-tracking branch 'nik9000/127431' into 127431
nik9000 61fb19e
revert mute change
nik9000 2366ffb
more revert
nik9000 32d1409
Merge branch 'main' into 127431
nik9000 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| pr: 127532 | ||
| summary: Fix case insensitive comparisons to "" | ||
| area: ES|QL | ||
| type: bug | ||
| issues: | ||
| - 127431 |
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
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
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
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
79 changes: 79 additions & 0 deletions
79
x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/210_empty_string.yml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| --- | ||
| setup: | ||
| - requires: | ||
| test_runner_features: [ capabilities ] | ||
| capabilities: | ||
| - method: POST | ||
| path: /_query | ||
| parameters: [ ] | ||
| capabilities: [ query_monitoring ] | ||
| reason: "uses query monitoring" | ||
|
|
||
| - do: | ||
| bulk: | ||
| index: "test" | ||
| refresh: true | ||
| body: | ||
| - { "index": { } } | ||
| - { "@timestamp": "2023-10-23T13:55:01.543Z", "message": "" } | ||
| - { "index": { } } | ||
| - { "@timestamp": "2023-10-23T13:55:01.544Z" } | ||
| - { "index": { } } | ||
| - { "@timestamp": "2023-10-23T13:55:01.545Z", "message": "a" } | ||
|
|
||
| --- | ||
| keyword equals empty string: | ||
| - do: | ||
| esql.query: | ||
| body: | ||
| query: 'FROM test | WHERE message.keyword == "" | SORT @timestamp ASC | KEEP @timestamp | LIMIT 10' | ||
|
|
||
| - match: { columns.0.name: "@timestamp" } | ||
| - match: { columns.0.type: "date" } | ||
| - length: { values: 1 } | ||
| - match: { values.0.0: 2023-10-23T13:55:01.543Z } | ||
|
|
||
| --- | ||
| keyword to_lower equals empty string: | ||
| - do: | ||
| esql.query: | ||
| body: | ||
| query: 'FROM test | WHERE TO_LOWER(message.keyword) == "" | SORT @timestamp ASC | KEEP @timestamp | LIMIT 10' | ||
|
|
||
| - match: { columns.0.name: "@timestamp" } | ||
| - match: { columns.0.type: "date" } | ||
| - length: { values: 1 } | ||
| - match: { values.0.0: 2023-10-23T13:55:01.543Z } | ||
|
|
||
| --- | ||
| text equals empty string: | ||
| - do: | ||
| esql.query: | ||
| body: | ||
| query: 'FROM test | WHERE message == "" | SORT @timestamp ASC | KEEP @timestamp | LIMIT 10' | ||
|
|
||
| - match: { columns.0.name: "@timestamp" } | ||
| - match: { columns.0.type: "date" } | ||
| - length: { values: 1 } | ||
| - match: { values.0.0: 2023-10-23T13:55:01.543Z } | ||
|
|
||
| --- | ||
| text to_lower equals empty string: | ||
| - requires: | ||
| test_runner_features: [ capabilities ] | ||
| capabilities: | ||
| - method: POST | ||
| path: /_query | ||
| parameters: [ ] | ||
| capabilities: [ to_lower_empty_string ] | ||
| reason: "bug" | ||
|
|
||
| - do: | ||
| esql.query: | ||
| body: | ||
| query: 'FROM test | WHERE TO_LOWER(message) == "" | SORT @timestamp ASC | KEEP @timestamp | LIMIT 10' | ||
|
|
||
| - match: { columns.0.name: "@timestamp" } | ||
| - match: { columns.0.type: "date" } | ||
| - length: { values: 1 } | ||
| - match: { values.0.0: 2023-10-23T13:55:01.543Z } |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_search works around this as well with:
Which makes sense. And it's slightly faster. Here, instead of doing a term query I just make an automata for the empty string. We are already pushing a proper term query using the _search infrastructure when possible.