use of org.apache.drill.exec.vector.BitVector in project drill by apache.
the class TestAllocators method testClearBitVector.
@Test
public void testClearBitVector() {
final Properties props = new Properties() {
{
put(RootAllocatorFactory.TOP_LEVEL_MAX_ALLOC, "1000000");
}
};
final DrillConfig config = DrillConfig.create(props);
final BufferAllocator allc = RootAllocatorFactory.newRoot(config);
final TypeProtos.MajorType.Builder builder = TypeProtos.MajorType.newBuilder();
builder.setMinorType(TypeProtos.MinorType.BIT);
builder.setMode(TypeProtos.DataMode.REQUIRED);
final BitVector bv = new BitVector(MaterializedField.create("Field", builder.build()), allc);
bv.getMutator().setValueCount(1);
assertEquals(bv.getAccessor().getValueCount(), 1);
bv.clear();
assertEquals(bv.getAccessor().getValueCount(), 0);
}
Aggregations