Skip to content

docs: describe how joins are chosen under AQE - #2479

Open
NoahKusaba wants to merge 2 commits into
apache:mainfrom
NoahKusaba:docs/join-strategy-under-aqe
Open

NoahKusaba wants to merge 2 commits into
apache:mainfrom
NoahKusaba:docs/join-strategy-under-aqe

Conversation

@NoahKusaba

@NoahKusaba NoahKusaba commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

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 = true to get hash joins, but under AQE, the default, that setting is not consulted.

What changes are included in this PR?

  • Split the section into With AQE (the default) and With AQE turned off.
  • Under AQE, the join is chosen at runtime from measured sizes: broadcast below ballista.optimizer.broadcast_join_threshold_bytes, a partitioned hash join while every build partition is under ballista.optimizer.hash_join_max_build_partition_bytes, and a sort-merge join otherwise.
  • With AQE off, keep the existing advice, now scoped to that case. It also notes that the static planner only promotes hash joins to broadcast, so the sort-merge default means no broadcast joins.
  • The opt-in example now also sets ballista.planner.adaptive.enabled = false, since prefer_hash_join does 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

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>
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Sep 22, 2026
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>

@milenkovicm milenkovicm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @NoahKusaba

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants