viirya commented on code in PR #40043:
URL: https://github.com/apache/arrow/pull/40043#discussion_r1485839154


##########
java/vector/src/main/java/org/apache/arrow/vector/complex/BaseRepeatedValueVector.java:
##########
@@ -97,11 +98,13 @@ public boolean allocateNewSafe() {
     return dataAlloc;
   }
 
-  protected void allocateOffsetBuffer(final long size) {
+  protected void allocateOffsetBuffer(final long size, boolean init) {
     final int curSize = (int) size;
     offsetBuffer = allocator.buffer(curSize);
     offsetBuffer.readerIndex(0);
-    offsetAllocationSizeInBytes = curSize;
+    if (!init) {
+      offsetAllocationSizeInBytes = curSize;
+    }

Review Comment:
   This is to avoid changing `offsetAllocationSizeInBytes` to the initial 4 
byte size. Otherwise, `reallocOffsetBuffer` will take it and cause some tests 
failed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to