Chao Sun created ARROW-14718:
--------------------------------
Summary: [Java] loadValidityBuffer should avoid allocating memory
when input is not null and there are only null or non-null values
Key: ARROW-14718
URL: https://issues.apache.org/jira/browse/ARROW-14718
Project: Apache Arrow
Issue Type: Improvement
Components: Java
Reporter: Chao Sun
Currently in {{BitVectorHelper.loadValidityBuffer}}, we always allocate memory
when the source vector contains only null or non-null values. However, as the
format also allows allocating validity buffer even if all values are null or
not-null, the method should also consider whether the input validity buffer is
null or not, and avoiding allocating new buffer when it is latter.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)