Local worker allocations#559
Open
gabotechs wants to merge 1 commit into
Open
Conversation
gabotechs
force-pushed
the
gabrielmusat/local-worker-allocations
branch
2 times, most recently
from
July 20, 2026 09:45
f6799a0 to
2dbf1fb
Compare
gabotechs
marked this pull request as ready for review
July 20, 2026 10:36
gabotechs
force-pushed
the
gabrielmusat/local-worker-allocations
branch
2 times, most recently
from
July 21, 2026 10:12
af42530 to
2183672
Compare
gabotechs
force-pushed
the
gabrielmusat/local-worker-allocations
branch
from
July 21, 2026 12:17
2183672 to
407fbeb
Compare
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.
Small optimization that allows the dynamic planner to collocate single-tasked stages into the same machine that is acting as coordinator.
During dynamic planning, if all stages are small, they will just use 1 task, and before this PR, there was already some logic for co-locating all stages in a single worker. The challenge:
The single worker was a random worker in the cluster.
This means that if the coordinating context also happens to be in the scope of a worker, there's a missed chance for running everything locally, almost as if it was just single-node DataFusion.
This PRs unlocks this scenario by allowing users to inject their own
LocalWorkerContextinto the coordinatingSessionContext. That way, the coordinator itself can recognize it's also a worker, and can send to itself all these single-tasked stages, avoiding network hops and data serialization.Benchmarks
TPCH-SF1: 1.12 faster ✔
TPCH-SF10: 1.06 faster ✔
TPCH-SF100: 1.01 faster ✔
TPC-DS: 1.08 faster ✔
ClickBench: 1.01 faster ✔