leanken commented on a change in pull request #29389:
URL: https://github.com/apache/spark/pull/29389#discussion_r467945765
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala
##########
@@ -223,19 +223,19 @@ case class BroadcastHashJoinExec(
* Handles NULL-aware anti join (NAAJ) separately here.
*/
protected override def codegenAnti(ctx: CodegenContext, input:
Seq[ExprCode]): String = {
- if (isNullAwareAntiJoin) {
- val (broadcastRelation, relationTerm) = prepareBroadcast(ctx)
+ val (broadcastRelation, relationTerm) = prepareBroadcast(ctx)
Review comment:
I was also consider doing it inside BHJ because in ShuffledHashJoinExec
the hashedRelation is built among generated-code, it might be hard to just
return hashedRelation in prepareRelation call.
```
protected override def prepareRelation(ctx: CodegenContext): (String,
Boolean) = {
val thisPlan = ctx.addReferenceObj("plan", this)
val clsName = classOf[HashedRelation].getName
// Inline mutable state since not many join operations in a task
val relationTerm = ctx.addMutableState(clsName, "relation",
v => s"$v = $thisPlan.buildHashedRelation(inputs[1]);", forceInline =
true)
(relationTerm, false)
}
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]