-
Notifications
You must be signed in to change notification settings - Fork 25.6k
ES|QL: Add FUSE as a copy of RRF #130434
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
ES|QL: Add FUSE as a copy of RRF #130434
Changes from all commits
Commits
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
136 changes: 136 additions & 0 deletions
136
x-pack/plugin/esql/qa/testFixtures/src/main/resources/fuse.csv-spec
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,136 @@ | ||
| // | ||
| // CSV spec for FUSE command | ||
| // | ||
|
|
||
| simpleFuse | ||
| required_capability: fork_v9 | ||
| required_capability: fuse | ||
| required_capability: match_operator_colon | ||
|
|
||
| FROM employees METADATA _id, _index, _score | ||
| | FORK ( WHERE emp_no:10001 ) | ||
| ( WHERE emp_no:10002 ) | ||
| | FUSE | ||
| | EVAL _score = round(_score, 4) | ||
| | KEEP _score, _fork, emp_no | ||
| | SORT _score, _fork, emp_no | ||
| ; | ||
|
|
||
| _score:double | _fork:keyword | emp_no:integer | ||
| 0.0164 | fork1 | 10001 | ||
| 0.0164 | fork2 | 10002 | ||
| ; | ||
|
|
||
| fuseWithMatchAndScore | ||
| required_capability: fork_v9 | ||
| required_capability: fuse | ||
| required_capability: match_operator_colon | ||
|
|
||
| FROM books METADATA _id, _index, _score | ||
| | FORK ( WHERE title:"Tolkien" | SORT _score, _id DESC | LIMIT 3 ) | ||
| ( WHERE author:"Tolkien" | SORT _score, _id DESC | LIMIT 3 ) | ||
| | FUSE | ||
| | SORT _score DESC, _id, _index | ||
| | EVAL _fork = mv_sort(_fork) | ||
| | EVAL _score = round(_score, 5) | ||
| | KEEP _score, _fork, _id | ||
| ; | ||
|
|
||
| _score:double | _fork:keyword | _id:keyword | ||
| 0.03279 | [fork1, fork2] | 4 | ||
| 0.01613 | fork1 | 56 | ||
| 0.01613 | fork2 | 60 | ||
| 0.01587 | fork2 | 1 | ||
| 0.01587 | fork1 | 26 | ||
| ; | ||
|
|
||
| fuseWithDisjunctionAndPostFilter | ||
| required_capability: fork_v9 | ||
| required_capability: fuse | ||
| required_capability: match_operator_colon | ||
|
|
||
| FROM books METADATA _id, _index, _score | ||
| | FORK ( WHERE title:"Tolkien" OR author:"Tolkien" | SORT _score, _id DESC | LIMIT 3 ) | ||
| ( WHERE author:"Tolkien" | SORT _score, _id DESC | LIMIT 3 ) | ||
| | FUSE | ||
| | SORT _score DESC, _id, _index | ||
| | EVAL _fork = mv_sort(_fork) | ||
| | EVAL _score = round(_score, 5) | ||
| | KEEP _score, _fork, _id | ||
| | WHERE _score > 0.014 | ||
| ; | ||
|
|
||
| _score:double | _fork:keyword | _id:keyword | ||
| 0.03252 | [fork1, fork2] | 60 | ||
| 0.032 | [fork1, fork2] | 1 | ||
| 0.01639 | fork2 | 4 | ||
| 0.01587 | fork1 | 40 | ||
| ; | ||
|
|
||
| fuseWithStats | ||
| required_capability: fork_v9 | ||
| required_capability: fuse | ||
| required_capability: match_operator_colon | ||
|
|
||
| FROM books METADATA _id, _index, _score | ||
| | FORK ( WHERE title:"Tolkien" | SORT _score, _id DESC | LIMIT 3 ) | ||
| ( WHERE author:"Tolkien" | SORT _score, _id DESC | LIMIT 3 ) | ||
| ( WHERE author:"Ursula K. Le Guin" AND title:"short stories" | SORT _score, _id DESC | LIMIT 3) | ||
| | FUSE | ||
| | STATS count_fork=COUNT(*) BY _fork | ||
| | SORT _fork | ||
| ; | ||
|
|
||
| count_fork:long | _fork:keyword | ||
| 3 | fork1 | ||
| 3 | fork2 | ||
| 1 | fork3 | ||
| ; | ||
|
|
||
| fuseWithMultipleForkBranches | ||
| required_capability: fork_v9 | ||
| required_capability: fuse | ||
| required_capability: match_operator_colon | ||
|
|
||
| FROM books METADATA _id, _index, _score | ||
| | FORK (WHERE author:"Keith Faulkner" AND qstr("author:Rory or author:Beverlie") | SORT _score, _id DESC | LIMIT 3) | ||
| (WHERE author:"Ursula K. Le Guin" | SORT _score, _id DESC | LIMIT 3) | ||
| (WHERE title:"Tolkien" AND author:"Tolkien" AND year > 2000 AND mv_count(author) == 1 | SORT _score, _id DESC | LIMIT 3) | ||
| (WHERE match(author, "Keith Faulkner") AND match(author, "Rory Tyger") | SORT _score, _id DESC | LIMIT 3) | ||
| | FUSE | ||
| | SORT _score DESC, _id, _index | ||
| | EVAL _fork = mv_sort(_fork) | ||
| | EVAL _score = round(_score, 4) | ||
| | EVAL title = trim(substring(title, 1, 20)) | ||
| | KEEP _score, author, title, _fork | ||
| ; | ||
|
|
||
| _score:double | author:keyword | title:keyword | _fork:keyword | ||
| 0.0328 | [Keith Faulkner, Rory Tyger] | Pop! Went Another Ba | [fork1, fork4] | ||
| 0.0164 | J.R.R. Tolkien | Letters of J R R Tol | fork3 | ||
| 0.0164 | Ursula K. Le Guin | The wind's twelve qu | fork2 | ||
| 0.0161 | [Beverlie Manson, Keith Faulkner] | Rainbow's End: A Mag | fork1 | ||
| 0.0161 | Ursula K. Le Guin | The Word For World i | fork2 | ||
| 0.0159 | Ursula K. Le Guin | The Dispossessed | fork2 | ||
| ; | ||
|
|
||
| fuseWithSemanticSearch | ||
| required_capability: fork_v9 | ||
| required_capability: fuse | ||
| required_capability: semantic_text_field_caps | ||
| required_capability: metadata_score | ||
|
|
||
| FROM semantic_text METADATA _id, _score, _index | ||
| | FORK ( WHERE semantic_text_field:"something" | SORT _score DESC | LIMIT 2) | ||
| ( WHERE semantic_text_field:"something else" | SORT _score DESC | LIMIT 2) | ||
| | FUSE | ||
| | SORT _score DESC, _id, _index | ||
| | EVAL _score = round(_score, 4) | ||
| | EVAL _fork = mv_sort(_fork) | ||
| | KEEP _fork, _score, _id, semantic_text_field | ||
| ; | ||
|
|
||
| _fork:keyword | _score:double | _id:keyword | semantic_text_field:keyword | ||
| [fork1, fork2] | 0.0328 | 2 | all we have to decide is what to do with the time that is given to us | ||
| [fork1, fork2] | 0.0323 | 3 | be excellent to each other | ||
| ; | ||
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 |
|---|---|---|
|
|
@@ -60,6 +60,7 @@ import ChangePoint, | |
| Expression, | ||
| From, | ||
| Fork, | ||
| Fuse, | ||
| Join, | ||
| Lookup, | ||
| MvExpand, | ||
|
|
||
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.
this is pretty much a copy of the RRF csv tests