cloud-fan commented on a change in pull request #29572: URL: https://github.com/apache/spark/pull/29572#discussion_r482002324
########## File path: sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala ########## @@ -673,8 +680,29 @@ private[joins] class SortMergeJoinScanner( */ private[this] var matchJoinKey: InternalRow = _ /** Buffered rows from the buffered side of the join. This is empty if there are no matches. */ - private[this] val bufferedMatches = + private[this] val bufferedMatches: AppendOnlyUnsafeRowArray = if (bufferFirstOnly) { + new AppendOnlyUnsafeRowArray { + var buffer: UnsafeRow = null + + override def clear(): Unit = { + buffer = null + } + + override def add(row: UnsafeRow): Unit = { + assert(buffer == null) Review comment: How did you test it if `ExternalAppendOnlyUnsafeRowArray` doesn't spill either? ---------------------------------------------------------------- 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