cloud-fan commented on a change in pull request #32528:
URL: https://github.com/apache/spark/pull/32528#discussion_r631598224
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala
##########
@@ -424,8 +424,18 @@ case class SortMergeJoinExec(
// A list to hold all matched rows from buffered side.
val clsName = classOf[ExternalAppendOnlyUnsafeRowArray].getName
+ // Flag to only buffer first matched row, to avoid buffering unnecessary
rows.
+ val onlyBufferFirstMatchedRow = (joinType, condition) match {
+ case (LeftSemi, None) => true
+ case _ => false
+ }
+ val inMemoryThreshold =
+ if (onlyBufferFirstMatchedRow) {
Review comment:
+1, `lazy val` can probably be `def` as the logic is super simple
--
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]