Skip to content

Commit

Permalink
fix leakage in rowtocolumn (oap-project#683)
Browse files Browse the repository at this point in the history
Signed-off-by: Yuan Zhou <[email protected]>
  • Loading branch information
zhouyuan committed Jan 9, 2022
1 parent 7acd123 commit 49513fa
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 49513fa

Please sign in to comment.