liyafan82 commented on a change in pull request #8214:
URL: https://github.com/apache/arrow/pull/8214#discussion_r494707070



##########
File path: java/vector/src/main/java/org/apache/arrow/vector/BitVector.java
##########
@@ -126,7 +126,12 @@ public void setInitialCapacity(int valueCount) {
    */
   @Override
   public int getValueCapacity() {
-    return capAtMaxInt(validityBuffer.capacity() * 8);
+    return actualValueCapacity;
+  }
+
+  @Override
+  protected void refreshValueCapacity() {
+    actualValueCapacity = capAtMaxInt(validityBuffer.capacity() * 8);

Review comment:
       I am a little surprised here (I am aware that it was copied from the 
original implementation): the value capacity of a BitVector should also 
consider the capacity of the data buffer. So I think the original 
implementation has a bug here?




----------------------------------------------------------------
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.

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


Reply via email to