[AURON #2437] Support inner residual join conditions in native broadcast hash join - #2438
Open
weimingdiit wants to merge 1 commit into
Open
Conversation
…broadcast hash join
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends Auron’s native Broadcast Hash Join (BHJ) support for inner joins to handle Spark’s residual (non-equi) join conditions by converting the condition into the existing JoinFilter representation, serializing it into the native protobuf plan, and evaluating it inside the native join operator against candidate matches produced by the hash lookup.
Changes:
- Plumbs
BroadcastHashJoinExec.conditionintoNativeBroadcastJoinExec/NativeBroadcastJoinBase, converting it to a nativeJoinFilterand embedding it in the BHJ protobuf node (inner joins only). - Updates the native planner and BHJ implementation to parse and apply the join filter during native execution (including both build sides).
- Adds Scala + Rust test coverage validating BHJ residual-condition execution for both
BuildLeftandBuildRight.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| spark-extension/src/main/scala/org/apache/spark/sql/execution/auron/plan/NativeBroadcastJoinBase.scala | Adds residual-condition → JoinFilter conversion and attaches it to the BHJ protobuf node (inner-only assertion). |
| spark-extension/src/main/scala/org/apache/spark/sql/auron/Shims.scala | Extends the shim API to pass an optional join condition into native broadcast join construction. |
| spark-extension/src/main/scala/org/apache/spark/sql/auron/AuronConverters.scala | Validates (config + inner-only) and forwards residual conditions when converting BroadcastHashJoinExec to native. |
| spark-extension/src/main/java/org/apache/auron/spark/configuration/SparkAuronConfiguration.java | Updates config description to include BHJ residual-condition evaluation. |
| spark-extension-shims-spark/src/test/scala/org/apache/auron/AuronQuerySuite.scala | Adds a Spark-side test asserting native BHJ is chosen and that the residual condition is present for both build sides. |
| spark-extension-shims-spark/src/main/scala/org/apache/spark/sql/execution/joins/auron/plan/NativeBroadcastJoinExec.scala | Carries Spark’s condition through the native BHJ exec node instead of forcing None. |
| spark-extension-shims-spark/src/main/scala/org/apache/spark/sql/auron/ShimsImpl.scala | Wires the new condition parameter into the Spark shim implementation. |
| native-engine/datafusion-ext-plans/src/joins/test.rs | Adds a native-engine unit test for BHJ inner join with a residual filter on both probe/build configurations. |
| native-engine/datafusion-ext-plans/src/joins/bhj/full_join.rs | Enables join-filter evaluation in BHJ inner join path (and updates the error message for non-inner/outer usage). |
| native-engine/datafusion-ext-plans/src/broadcast_join_exec.rs | Allows join_filter for inner BHJ (removes the prior restriction tied to is_built). |
| native-engine/auron-planner/src/planner.rs | Parses the new BHJ filter field from protobuf and enforces inner-only semantics in the planner. |
| native-engine/auron-planner/proto/auron.proto | Adds JoinFilter filter to BroadcastJoinExecNode protobuf schema. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 #2437
Rationale for this change
Auron currently cannot execute Spark broadcast hash joins natively when an inner join contains a residual non-equi condition in addition to its equi-join keys.
Supporting these conditions improves native execution coverage for common broadcast join queries and keeps the condition evaluation inside the join operator.
What changes are included in this PR?
Outer, semi, anti, null-aware anti, and broadcast nested-loop join condition support are not included.
Are there any user-facing changes?
No user-facing API changes. More inner broadcast hash joins with residual conditions can now be executed natively by Auron.
How was this patch tested?
UT.
Was this patch authored or co-authored using generative AI tooling?
Generated-by: OpenAI Codex (GPT-5)