-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Stream result pages from sub plans for FORK #126705
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 2 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
bfb9dee
Stream result pages from sub plans for FORK
ioanatia c209f02
Use different capability for csv tests
ioanatia 07a0b20
Add javadoc
ioanatia 0ff3676
Merge branch 'elasticsearch/main' into fork_streaming
ioanatia 7b0aaa3
Fix RRF tests
ioanatia 753632d
Remove MergeOperator since it's no longer needed
ioanatia 768c581
Fix another RRF test
ioanatia 0d83c20
Merge branch 'elasticsearch/main' into fork_streaming
ioanatia b6ecc10
Add empty sink to prevent exchange source to finish too early
ioanatia 62902e4
Merge branch 'main' into fork_streaming
ioanatia 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,13 +36,15 @@ | |
| import org.elasticsearch.xpack.esql.plan.QueryPlan; | ||
| import org.elasticsearch.xpack.esql.plan.logical.EsRelation; | ||
| import org.elasticsearch.xpack.esql.plan.logical.Filter; | ||
| import org.elasticsearch.xpack.esql.plan.logical.Project; | ||
| import org.elasticsearch.xpack.esql.plan.physical.AggregateExec; | ||
| import org.elasticsearch.xpack.esql.plan.physical.EsSourceExec; | ||
| import org.elasticsearch.xpack.esql.plan.physical.EstimatesRowSize; | ||
| import org.elasticsearch.xpack.esql.plan.physical.ExchangeExec; | ||
| import org.elasticsearch.xpack.esql.plan.physical.ExchangeSinkExec; | ||
| import org.elasticsearch.xpack.esql.plan.physical.ExchangeSourceExec; | ||
| import org.elasticsearch.xpack.esql.plan.physical.FragmentExec; | ||
| import org.elasticsearch.xpack.esql.plan.physical.MergeExec; | ||
| import org.elasticsearch.xpack.esql.plan.physical.PhysicalPlan; | ||
| import org.elasticsearch.xpack.esql.planner.mapper.LocalMapper; | ||
| import org.elasticsearch.xpack.esql.planner.mapper.Mapper; | ||
|
|
@@ -67,6 +69,25 @@ | |
|
|
||
| public class PlannerUtils { | ||
|
|
||
| public static Tuple<List<PhysicalPlan>, PhysicalPlan> breakPlanIntoSubPlansAndMainPlan(PhysicalPlan plan) { | ||
|
Contributor
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. Can you please add a short javadoc description. |
||
| var subplans = new Holder<List<PhysicalPlan>>(); | ||
| PhysicalPlan mainPlan = plan.transformUp(MergeExec.class, me -> { | ||
| subplans.set(me.children().stream().map(child -> { | ||
| // TODO: we are adding a Project plan to force InsertFieldExtraction - we should remove this transformation | ||
| child = child.transformUp(FragmentExec.class, f -> { | ||
| var logicalFragment = f.fragment(); | ||
| logicalFragment = new Project(logicalFragment.source(), logicalFragment, logicalFragment.output()); | ||
| return new FragmentExec(logicalFragment); | ||
| }); | ||
|
|
||
| return (PhysicalPlan) new ExchangeSinkExec(child.source(), child.output(), false, child); | ||
| }).toList()); | ||
| return new ExchangeSourceExec(me.source(), me.output(), false); | ||
| }); | ||
|
|
||
| return new Tuple<>(subplans.get(), mainPlan); | ||
| } | ||
|
|
||
| public static Tuple<PhysicalPlan, PhysicalPlan> breakPlanBetweenCoordinatorAndDataNode(PhysicalPlan plan, Configuration config) { | ||
| var dataNodePlan = new Holder<PhysicalPlan>(); | ||
|
|
||
|
|
||
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
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.
It seems obvious now, but I like how this capability can be effectively incremented (without affecting previous releases and or over excessively polluting). This could be a good pattern to socialise.
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.
I noticed this approach with lookup join and it made sense to reuse here.