-
Notifications
You must be signed in to change notification settings - Fork 25.3k
ESQL: Push down filter passed lookup join #118410
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 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
e8ffd92
ESQL: Push down filter passed lookup join
costin 5010855
Update docs/changelog/118410.yaml
costin 11a53ce
Add unit tests
costin 659e090
Add CSV tests
costin e8cbe94
Merge branch 'main' into esql/push-filter-through-join
costin b6ab3fb
Address feedback
costin ce4dfd0
Use proper suffix
costin 642464b
Fix typos
costin bd9a510
Merge branch 'main' into esql/push-filter-through-join
costin e9bab98
Merge branch 'main' into esql/push-filter-through-join
costin f03ff19
Pickup updates in main
costin 62dee1b
Merge remote-tracking branch 'remotes/upstream/main' into esql/push-f…
costin 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
Add CSV tests
Polish
- Loading branch information
commit 659e090722cafc1caf7f5b18802387c3b9ce9204
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
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 |
---|---|---|
|
@@ -325,3 +325,68 @@ count:long | type:keyword | |
3 | Success | ||
1 | Disconnected | ||
; | ||
|
||
// | ||
// Filtering tests | ||
// | ||
|
||
lookupWithFilterOnLeftSideField | ||
required_capability: join_lookup_v4 | ||
|
||
FROM employees | ||
| EVAL language_code = languages | ||
| LOOKUP JOIN languages_lookup ON language_code | ||
| SORT emp_no | ||
| KEEP emp_no, language_code, language_name | ||
| WHERE emp_no >= 10091 AND emp_no < 10094 | ||
; | ||
|
||
emp_no:integer | language_code:integer | language_name:keyword | ||
10091 | 3 | Spanish | ||
10092 | 1 | English | ||
10093 | 3 | Spanish | ||
; | ||
|
||
lookupMessageWithFilterOnRightSideField-Ignored | ||
required_capability: join_lookup_v4 | ||
|
||
FROM sample_data | ||
| LOOKUP JOIN message_types_lookup ON message | ||
| WHERE type == "Error" | ||
| KEEP @timestamp, client_ip, event_duration, message, type | ||
| SORT @timestamp DESC | ||
; | ||
|
||
@timestamp:date | client_ip:ip | event_duration:long | message:keyword | type:keyword | ||
2023-10-23T13:53:55.832Z | 172.21.3.15 | 5033755 | Connection error | Error | ||
2023-10-23T13:52:55.015Z | 172.21.3.15 | 8268153 | Connection error | Error | ||
2023-10-23T13:51:54.732Z | 172.21.3.15 | 725448 | Connection error | Error | ||
; | ||
|
||
lookupWithFieldAndRightSideAfterStats | ||
required_capability: join_lookup_v4 | ||
|
||
FROM sample_data | ||
| LOOKUP JOIN message_types_lookup ON message | ||
| STATS count = count(message) BY type | ||
| WHERE type == "Error" | ||
; | ||
|
||
count:long | type:keyword | ||
3 | Error | ||
; | ||
|
||
lookupWithFieldOnJoinKey-Ignored | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The filter on right side removes all data, likely due to considering the field as missing. |
||
required_capability: join_lookup_v4 | ||
|
||
FROM employees | ||
| EVAL language_code = languages | ||
| LOOKUP JOIN languages_lookup ON language_code | ||
| WHERE language_code > 1 AND language_name IS NOT NULL | ||
| KEEP emp_no, language_code, language_name | ||
; | ||
|
||
emp_no:integer | language_code:integer | language_name:keyword | ||
10001 | 2 | French | ||
10003 | 4 | German | ||
; |
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
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.
The filter on right side removes all data, likely due to considering the field as missing.
We have a bug for that so I just disabled the test for now.