[ES|QL] COMPLETION command logical plan optimizer#126763
Merged
afoucret merged 8 commits intoelastic:mainfrom Apr 16, 2025
Merged
[ES|QL] COMPLETION command logical plan optimizer#126763afoucret merged 8 commits intoelastic:mainfrom
afoucret merged 8 commits intoelastic:mainfrom
Conversation
Collaborator
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
11 tasks
carlosdelest
approved these changes
Apr 14, 2025
Member
carlosdelest
left a comment
There was a problem hiding this comment.
LGTM - have a question about some code being tested
|
|
||
| // from ... | where a > 1 | COMPLETION "some prompt" WITH reranker AS completion | where b < 2 and match(completion, some text) | ||
| // => ... | where a > 1 AND b < 2| COMPLETION "some prompt" WITH reranker AS completion | match(completion, some text) | ||
| public void testPushDownFilterPastCompletion() { |
Member
There was a problem hiding this comment.
I might have missed this - is the PushDownAndCombineLimits change being tested?
Contributor
Author
There was a problem hiding this comment.
Added some test for PushDownAndCombineLimits (it is wild but none were created for other commands)
Contributor
There was a problem hiding this comment.
The LogicalPlanOptimizerTests have testCombineLimits and testMultipleCombineLimits, but indeed, I don't immediately see tests for the case where there are compatible plans between the two limits. Thanks a lot for the added tests.
ee35f39 to
4eab7d5
Compare
17 tasks
afoucret
added a commit
to afoucret/elasticsearch
that referenced
this pull request
Jun 4, 2025
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.
The
COMPLETIONcommand is expected to be costly because it is doing an inference for each row of the dataset.This PR tries to limit the number of rows to process by applying the same logical plan than others
GeneratingPlan(Eval,Enrich,RegexExtract, ...):COMPLETIONcommand when possibleCOMPLETIONcommand when possibleWork for the completion command is tracked in: #124405
PS: the command is available only for snapshot build.