Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

Commit

Permalink
fix leakage in rowtocolumn (#683)
Browse files Browse the repository at this point in the history
Signed-off-by: Yuan Zhou <[email protected]>
  • Loading branch information
zhouyuan authored Jan 9, 2022
1 parent 8e9f4fe commit 878e660
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import org.apache.spark.sql.execution.vectorized.WritableColumnVector
import org.apache.spark.sql.types._
import org.apache.spark.sql.util.ArrowUtils
import org.apache.spark.sql.vectorized.{ColumnVector, ColumnarBatch}
import org.apache.spark.TaskContext
import org.apache.spark.unsafe.Platform


Expand Down Expand Up @@ -104,7 +105,9 @@ class ArrowRowToColumnarExec(child: SparkPlan) extends RowToColumnarExec(child =
override def hasNext: Boolean = {
rowIterator.hasNext
}

TaskContext.get().addTaskCompletionListener[Unit] { _ =>
arrowBuf.close()
}
override def next(): ColumnarBatch = {
var isUnsafeRow = true
var firstRow = InternalRow.apply()
Expand Down

0 comments on commit 878e660

Please sign in to comment.