emkornfield commented on a change in pull request #11709:
URL: https://github.com/apache/arrow/pull/11709#discussion_r755688801



##########
File path: 
java/vector/src/main/java/org/apache/arrow/vector/BitVectorHelper.java
##########
@@ -329,7 +329,8 @@ public static ArrowBuf loadValidityBuffer(final 
ArrowFieldNode fieldNode,
     final int valueCount = fieldNode.getLength();
     ArrowBuf newBuffer = null;
     /* either all NULLs or all non-NULLs */
-    if (fieldNode.getNullCount() == 0 || fieldNode.getNullCount() == 
valueCount) {
+    if (sourceValidityBuffer == null && (fieldNode.getNullCount() == 0 ||

Review comment:
       the sourceValidity buffer will can only be null if getNullCount == 0.  
It isn't clear to me why this code chose to always allocate a new buffer in 
this case as opposed to reusing the available one(I would have to trace it).  




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