LukaZdravic commented on code in PR #60240:
URL: https://github.com/apache/spark/pull/60240#discussion_r4514029152


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeAsOfJoinExec.scala:
##########
@@ -413,6 +414,17 @@ private[joins] class SortMergeAsOfJoinScanner(
     if (needsCopy) rightRow.copy() else rightRow
   }
 
+  /**
+   * Closes a right-group iterator, which the scans below often leave before 
its end. Once the
+   * group has spilled, the iterator holds a reader open on every spill file 
until it ends or is
+   * closed, so an unclosed one per left row would keep them all open until 
the task ends. A kept
+   * match is already a copy then, so closing the iterator does not change it.
+   */
+  private def closeIterator(iter: Iterator[UnsafeRow]): Unit = iter match {

Review Comment:
   Since this is a pre-existing issue I have created a ticket for it 
SPARK-61251.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to