Skip to content

Commit b9a3433

Browse files
DX-122953 Preserve list offset allocation size
1 parent 91dafa2 commit b9a3433

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎vector/src/main/java/org/apache/arrow/vector/complex/LargeListVector.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,10 @@ private void ensureEmptyOffsetBufferCapacity(long requiredCapacity) {
323323
if (offsetBuffer.capacity() >= requiredCapacity) {
324324
return;
325325
}
326+
long previousOffsetAllocationSizeInBytes = offsetAllocationSizeInBytes;
326327
ArrowBuf oldOffsetBuffer = offsetBuffer;
327328
offsetBuffer = allocateOffsetBuffer(requiredCapacity);
329+
offsetAllocationSizeInBytes = previousOffsetAllocationSizeInBytes;
328330
oldOffsetBuffer.getReferenceManager().release();
329331
}
330332

‎vector/src/main/java/org/apache/arrow/vector/complex/ListVector.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,10 @@ private void ensureEmptyOffsetBufferCapacity(long requiredCapacity) {
281281
if (offsetBuffer.capacity() >= requiredCapacity) {
282282
return;
283283
}
284+
long previousOffsetAllocationSizeInBytes = offsetAllocationSizeInBytes;
284285
ArrowBuf oldOffsetBuffer = offsetBuffer;
285286
offsetBuffer = allocateOffsetBuffer(requiredCapacity);
287+
offsetAllocationSizeInBytes = previousOffsetAllocationSizeInBytes;
286288
oldOffsetBuffer.getReferenceManager().release();
287289
}
288290

0 commit comments

Comments
 (0)