docs: describe how joins are chosen under AQE - #2479
Open
NoahKusaba wants to merge 2 commits into
Open
NoahKusaba wants to merge 2 commits into
NoahKusaba wants to merge 2 commits into
Conversation
The Join Strategy section only described the static planner. Under AQE, the default, datafusion.optimizer.prefer_hash_join is not consulted; the join is chosen at runtime from broadcast_join_threshold_bytes and hash_join_max_build_partition_bytes. Also, join reordering compares byte sizes first and falls back to row counts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
apache#2478 now merges the join reordering and broadcast join selection bullets into one Join selection bullet that covers the byte-size comparison, so this PR no longer needs to edit it, and would conflict if it did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Rationale for this change
The tuning guide's Join Strategy section only described the static planner. It told users to
SET datafusion.optimizer.prefer_hash_join = trueto get hash joins, but under AQE, the default, that setting is not consulted.What changes are included in this PR?
ballista.optimizer.broadcast_join_threshold_bytes, a partitioned hash join while every build partition is underballista.optimizer.hash_join_max_build_partition_bytes, and a sort-merge join otherwise.ballista.planner.adaptive.enabled = false, sinceprefer_hash_joindoes nothing otherwise.The "What AQE does today" list is left to #2478, which merges its join bullets into one Join selection bullet.
Are there any user-facing changes?
Documentation only, but this changes tuning advice users may have acted on, which is why it is a PR of its own. Worth a review from someone who knows the AQE join-selection rules.
Split out of #2438 to make it easier to review.
🤖 Generated with Claude Code