You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@auron.apache.org by "weimingdiit (via GitHub)" <gi...@apache.org> on 2026/07/28 09:48:36 UTC

[PR] [AURON #2437] Support inner residual join conditions in native broadcast hash join [auron]

weimingdiit opened a new pull request, #2438:
URL: https://github.com/apache/auron/pull/2438

   
   # 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?
   
   - Passes the BroadcastHashJoinExec residual condition to NativeBroadcastJoinExec.
   - Converts the residual condition to the existing native JoinFilter representation.
   - Adds the JoinFilter to the native broadcast join protobuf plan.
   - Parses and passes the filter through the native planner.
   - Evaluates the residual condition against candidate rows produced by the broadcast hash lookup.
   - Supports both BuildLeft and BuildRight.
   - Limits residual-condition support to inner broadcast hash joins.
   - Adds Scala and Rust test coverage for both broadcast build sides.
   
   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?
   
   - [x] Yes
   - [ ] No
   
   Generated-by: OpenAI Codex (GPT-5)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@auron.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [AURON #2437] Support inner residual join conditions in native broadcast hash join [auron]

Posted by "slfan1989 (via GitHub)" <gi...@apache.org>.
slfan1989 merged PR #2438:
URL: https://github.com/apache/auron/pull/2438


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@auron.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [AURON #2437] Support inner residual join conditions in native broadcast hash join [auron]

Posted by "weimingdiit (via GitHub)" <gi...@apache.org>.
weimingdiit commented on PR #2438:
URL: https://github.com/apache/auron/pull/2438#issuecomment-5350695001

   @slfan1989 @weiqingy Thanks for your review and merge!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@auron.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [AURON #2437] Support inner residual join conditions in native broadcast hash join [auron]

Posted by "weimingdiit (via GitHub)" <gi...@apache.org>.
weimingdiit commented on code in PR #2438:
URL: https://github.com/apache/auron/pull/2438#discussion_r3709177166


##########
spark-extension-shims-spark/src/test/scala/org/apache/auron/AuronQuerySuite.scala:
##########
@@ -883,6 +884,51 @@ class AuronQuerySuite extends AuronQueryTest with BaseAuronSQLSuite with AuronSQ
     }
   }
 
+  test("native broadcast hash join supports inner residual condition") {

Review Comment:
   @weiqingy @slfan1989 Thanks, agreed. This PR changes the accept side for inner broadcast hash joins with residual conditions, but the reject side is part of the contract as well.
   
   I added a negative LEFT JOIN case with a broadcast hint and a residual condition. The test checks the Spark answer and asserts that the executed plan does not contain NativeBroadcastJoinExec, so non-inner broadcast hash joins with residual conditions remain pinned to fallback.
   
   I kept this to one non-inner case because all of the guards use the same InnerLike predicate, so this should catch accidental broadening of the native BHJ residual-condition path without expanding the test matrix unnecessarily.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@auron.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [AURON #2437] Support inner residual join conditions in native broadcast hash join [auron]

Posted by "slfan1989 (via GitHub)" <gi...@apache.org>.
slfan1989 commented on PR #2438:
URL: https://github.com/apache/auron/pull/2438#issuecomment-5301187711

   @weimingdiit Thanks for the contribution! @weiqingy Thanks for the review!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@auron.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [AURON #2437] Support inner residual join conditions in native broadcast hash join [auron]

Posted by "weiqingy (via GitHub)" <gi...@apache.org>.
weiqingy commented on code in PR #2438:
URL: https://github.com/apache/auron/pull/2438#discussion_r3694512949


##########
spark-extension-shims-spark/src/test/scala/org/apache/auron/AuronQuerySuite.scala:
##########
@@ -883,6 +884,51 @@ class AuronQuerySuite extends AuronQueryTest with BaseAuronSQLSuite with AuronSQ
     }
   }
 
+  test("native broadcast hash join supports inner residual condition") {

Review Comment:
   This pins the inner accept path for both build sides, which is the half the PR changes. The other half of the contract in #2437 is "continue rejecting residual conditions for outer, semi, anti, and other broadcast join types", and there are now four guards enforcing it with no test behind any of them: `AuronConverters.scala:706`, `NativeBroadcastJoinBase.scala:129`, `planner.rs:433-437`, and `broadcast_join_exec.rs:110-112`. The Rust side is inner-only as well, since `bhj_collect_with_filter` pins `Inner` at `test.rs:399` and `:430`.
   
   #2197 set the same precedent for SMJ/SHJ, so nothing regressed here. Worth adding one negative case so the reject half is pinned too?
   
   One way it could look, in case it helps:
   
   ```scala
   val df = checkSparkAnswer("""
     |SELECT /*+ BROADCAST(r) */ l.id
     |FROM bhj_left l LEFT JOIN bhj_right r ON l.id = r.id AND l.lv < r.rv
     |""".stripMargin)
   assert(
     stripAQEPlan(df.queryExecution.executedPlan)
       .collectFirst { case _: NativeBroadcastJoinExec => true }
       .isEmpty)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@auron.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [AURON #2437] Support inner residual join conditions in native broadcast hash join [auron]

Posted by "weiqingy (via GitHub)" <gi...@apache.org>.
weiqingy commented on code in PR #2438:
URL: https://github.com/apache/auron/pull/2438#discussion_r3725094318


##########
spark-extension-shims-spark/src/test/scala/org/apache/auron/AuronQuerySuite.scala:
##########
@@ -883,6 +884,51 @@ class AuronQuerySuite extends AuronQueryTest with BaseAuronSQLSuite with AuronSQ
     }
   }
 
+  test("native broadcast hash join supports inner residual condition") {

Review Comment:
   Thanks, that closes my open item.
   
   Worth noting the assertion is doing real work here rather than passing for free: `LeftOuter` broadcast hash join is otherwise a supported native path (`join_left_one` in `joins/test.rs` runs it green across both BHJ probe sides), so the fallback in this test comes from the residual guard, not from the join type being unsupported to begin with.
   
   Nothing further from me. I'll leave the final call to the maintainers.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@auron.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org