You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/11/24 19:51:13 UTC

[GitHub] [arrow] sunchao commented on a change in pull request #11709: ARROW-14718: [Java] loadValidityBuffer should avoid allocating memory when input is not null and there are only null or non-null values

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



##########
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:
       Thanks @emkornfield , yea I missed that. Let me fix 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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org