Repository navigation
feat: support partitioned execution for ASOF joins - #26592
Open
Kristofferjoha wants to merge 6 commits into
Open
Kristofferjoha wants to merge 6 commits into
Kristofferjoha wants to merge 6 commits into
Conversation
Kristofferjoha
marked this pull request as ready for review
October 22, 2026 17:08
|
Thank you for opening this pull request! Reviewer note: cargo-semver-checks reported the current version number is not SemVer-compatible with the changes in this pull request (compared against the base branch). Details |
Contributor
Author
This is my first contribution. I am unsure as to how to handle this. |
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.
Which issue does this PR close?
Closes #26478.
Rationale for this change
ASOF joins currently collect the complete right input into a non-spillable reservation. Queries fail when that input exceeds the memory pool, even when upstream sorts can spill. Each left partition also scans the collected right input independently.
What changes are included in this PR?
AsOfJoinMode::Partitioned, requiring both inputs to be co-partitioned on equality keys and sorted within each partition. Each left partition streams its corresponding right partition.datafusion.optimizer.repartition_asof_joinsoption, defaulting tofalse. Joins without equality keys continue to use broadcast execution.The join itself does not spill: upstream sorts handle spilling, and the join still needs memory for its active working set. Skewed keys can reduce parallelism.
Existing ASOF SQL benchmarks compared with local
main(6c1727fcd), using four partitions and 12 measured samples per case after warm-up:What is the testing strategy for this PR?
Are there any user-facing changes?
Yes. Enable partitioned execution for ASOF joins with equality keys using:
The default execution strategy remains broadcast. The SQL guide and generated configuration reference document the option.
AI-assisted: I used an AI coding assistant while preparing this PR. I have reviewed and understand all changes.