Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ case class ColumnarCollectLimitExec(

if (rowsToSkip >= batchSize) {
rowsToSkip -= batchSize
batch.close()
} else {
val startIndex = rowsToSkip
val leftoverAfterSkip = batchSize - startIndex
Expand All @@ -82,7 +83,9 @@ case class ColumnarCollectLimitExec(
ColumnarBatches.retain(batch)
batch
} else {
VeloxColumnarBatches.slice(batch, startIndex, needed)
val sliced = VeloxColumnarBatches.slice(batch, startIndex, needed)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sliced calls velox slice API, reuse buffers of batch, so we cannot close it.

batch.close()
sliced
}

rowsToCollect -= needed
Expand Down
Loading