cloud-fan commented on a change in pull request #32476: URL: https://github.com/apache/spark/pull/32476#discussion_r630109240
########## File path: sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala ########## @@ -431,6 +433,66 @@ case class SortMergeJoinExec( // Copy the streamed keys as class members so they could be used in next function call. val matchedKeyVars = copyKeys(ctx, streamedKeyVars) + // Handle the case when streamed rows has any NULL keys. + val handleStreamedAnyNull = joinType match { + case _: InnerLike => + // Skip streamed row. + s""" + |$streamedRow = null; + |continue; + """.stripMargin + case LeftOuter | RightOuter => + // Eagerly return streamed row. Only call `matches.clear()` when `matches.isEmpty()` is + // false, to reduce unnecessary computation. + s""" + |if (!$matches.isEmpty()) { + | $matches.clear(); Review comment: shall we update `ExternalAppendOnlyUnsafeRowArray.clear()` to return earlier if `isEmpty == true`? -- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org