Commits

Chao Sun authored 902b5413edf
ARROW-14718: [Java] loadValidityBuffer should avoid allocating memory when input is not null and there are only null or non-null values 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](https://arrow.apache.org/docs/format/Columnar.html#validity-bitmaps) 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. Closes #11709 from sunchao/ARROW-14718 Authored-by: Chao Sun <sunchao@apache.org> Signed-off-by: Chao Sun <sunchao@apache.org>