ViggoC commented on code in PR #44078:
URL: https://github.com/apache/arrow/pull/44078#discussion_r1770742529


##########
java/vector/src/main/java/org/apache/arrow/vector/BaseVariableWidthViewVector.java:
##########
@@ -1251,6 +1252,7 @@ public void setNull(int index) {
     // We need to check and reallocate the validity buffer
     while (index >= getValueCapacity()) {
       reallocValidityBuffer();
+      reallocViewBuffer();

Review Comment:
   @danepitkin It's because getValueCapacity ` return 
Math.min(valueBufferCapacity, validityCapacity)`. If the valueBufferCapacity is 
lower, it will fall into a dead loop. 
   And another solution is to change the while condition to `index >= 
getValidityBufferValueCapacity()` so that it only realloc view buffer when we 
add non-null values like you said. But how to defined `getValueCapacity` in 
this case, it will return 0. 



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