Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public BitVector(String name, BufferAllocator allocator) {
public void load(ArrowFieldNode fieldNode, ArrowBuf data) {
// When the vector is all nulls or all defined, the content of the buffer can be omitted
if (data.readableBytes() == 0 && fieldNode.getLength() != 0) {
data.release();
int count = fieldNode.getLength();
allocateNew(count);
int n = getSizeFromCount(count);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ public void testLoadEmptyValidityBuffer() throws IOException {
new Field("intNull", true, new ArrowType.Int(32, true), Collections.<Field>emptyList())
));
int count = 10;
ArrowBuf validity = allocator.getEmpty();
// using Allocator.getEmpty() turns off ref counting
ArrowBuf validity = allocator.buffer(10).slice(0, 0);
ArrowBuf values = allocator.buffer(count * 4); // integers
for (int i = 0; i < count; i++) {
values.setInt(i * 4, i);
Expand Down Expand Up @@ -153,6 +154,7 @@ public void testLoadEmptyValidityBuffer() throws IOException {
assertFalse(intDefinedVector.getAccessor().isNull(count + 10));
assertEquals(1234, intDefinedVector.getAccessor().get(count + 10));
} finally {
validity.release();
values.release();
}
}
Expand Down