cloud-fan commented on a change in pull request #29389:
URL: https://github.com/apache/spark/pull/29389#discussion_r467683621
##########
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)
+ val numOutput = metricTerm(ctx, "numOutputRows")
+ if (broadcastRelation.value == EmptyHashedRelation) {
+ s"""
+ |// If the right side is empty, AntiJoin simply returns the left side.
+ |$numOutput.add(1);
+ |${consume(ctx, input)}
+ """.stripMargin
+ } else if (isNullAwareAntiJoin) {
val (keyEv, anyNull) = genStreamSideJoinKey(ctx, input)
val (matched, _, _) = getJoinCondition(ctx, input)
- val numOutput = metricTerm(ctx, "numOutputRows")
- if (broadcastRelation.value == EmptyHashedRelation) {
- s"""
- |// If the right side is empty, NAAJ simply returns the left side.
- |$numOutput.add(1);
- |${consume(ctx, input)}
- """.stripMargin
- } else if (broadcastRelation.value ==
EmptyHashedRelationWithAllNullKeys) {
+ if (broadcastRelation.value == EmptyHashedRelationWithAllNullKeys) {
Review comment:
shall we handle this case in AQE as well?
----------------------------------------------------------------
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]