srowen commented on a change in pull request #23762: [SPARK-21492][SQL][WIP]
Memory leak in SortMergeJoin
URL: https://github.com/apache/spark/pull/23762#discussion_r256111314
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala
##########
@@ -1140,9 +1167,26 @@ private class FullOuterIterator(
override def advanceNext(): Boolean = {
val r = smjScanner.advanceNext()
- if (r) numRows += 1
+ if (r) {
+ numRows += 1
+ } else {
+ smjScanner.close()
+ }
r
}
override def getRow: InternalRow = resultProj(joinedRow)
}
+
+trait CloseableScanner {
+ def closeIterator(iter: RowIterator): Unit = {
+ if (iter.isInstanceOf[RowIteratorFromScala]) {
Review comment:
I guess I figured this is just a static method in a companion object
somewhere. If there really isn't a meaningfully cleaner place, this is OK.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]