[WIP] feat(aqe): delay join decision & introduce broadcast join in AQE#1752
Draft
milenkovicm wants to merge 4 commits into
Draft
[WIP] feat(aqe): delay join decision & introduce broadcast join in AQE#1752milenkovicm wants to merge 4 commits into
milenkovicm wants to merge 4 commits into
Conversation
2f4e895 to
4a69e05
Compare
milenkovicm
commented
May 23, 2026
Contributor
Author
Q2 (Static Plan)Q2 (AQE) |
Contributor
Author
|
|
Contributor
Author
4a69e05 to
dbfacfa
Compare
dbfacfa to
6335c37
Compare
6335c37 to
d803f06
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.
Overview
This commit implements dynamic join strategy selection in Ballista's Adaptive Query Execution (AQE) pipeline. Instead of choosing a join strategy at planning time (when data sizes are unknown), the plan now inserts a placeholder
DynamicJoinSelectionExecnode that defers the decision until runtime statistics are available.The change means Ballista can now broadcast small tables or swap join sides based on real data sizes observed during execution, not just estimates from the logical plan.
Introduced planner rules consider few configuration values to decide join type:
datafusion.optimizer.hash_join_single_partition_threshold_rows, to select broadcast join or notdatafusion.optimizer.hash_join_single_partition_threshold, to select broadcast join or notdatafusion.optimizer.prefer_hash_jointo select actual preferred join implementationwith dynamic join selection some TPCH jobs have less stages created
compared to static scheduling
TODO
TPCH2, 13, 16ballista.planner.adaptive_join.enabledsort joinballista.optimizer.broadcast_join_threshold_bytesor go with datafusion configuration valuesTPCDSQ72testContext
this PR is part of #1359