Repository navigation
feat: support partitioned execution for ASOF joins - #26592
Kristofferjoha wants to merge 6 commits into
Conversation
|
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 |
This is my first contribution. I am unsure as to how to handle this. |
|
Thanks for the contribution! I am closing this under DataFusion's AI Dump policy. This has the hallmarks of AI code that was not reviewed by the author: a 1,400-line new join mode with config and proto changes and no design discussion before implementation. Please open an issue to discuss the design first; we would welcome that. If you would like to continue, please open a focused PR in your own words that you have reviewed and understand, and we are happy to help with review. |
|
@Kristofferjoha Thank you for the contribution. Sorry if our judgment about AI contributions has become too aggressive given the current challenges. I don't think this contribution is an AI dump, judging from the writeup. However, personally I won't prioritize reviewing this PR, this might be too ambitious for a new contributor. This work requires a deep understanding of the entire system, so I'd prefer to review it only when it comes from contributors I've worked with before. Sorry if this sounds overly conservative, but we haven't figured out a better approach given the current volume of AI-generated contributions. I'd suggest starting with smaller contributions to build trust with existing maintainers before taking on such a large feature in the future. (until we've figured out a better approach 😮💨 ) |
|
@2010YOUY01 Makes sense. I'll start with some smaller stuff to learn without it coming at the expense of the maintainers' time. |
|
Yes, thank you for understanding. We are really struggling to keep up with the influx of PRs and I agree some may be being closed to aggressively |
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.