Search in sources :

Example 1 with ListVector

use of org.apache.drill.exec.vector.complex.ListVector in project drill by apache.

the class TestValueVector method testListVectorShouldNotThrowOversizedAllocationException.

@Test
public void testListVectorShouldNotThrowOversizedAllocationException() throws Exception {
    final MaterializedField field = MaterializedField.create(EMPTY_SCHEMA_PATH, Types.optional(TypeProtos.MinorType.LIST));
    ListVector vector = new ListVector(field, allocator, null);
    ListVector vectorFrom = new ListVector(field, allocator, null);
    vectorFrom.allocateNew();
    for (int i = 0; i < 10000; i++) {
        vector.allocateNew();
        vector.copyFromSafe(0, 0, vectorFrom);
        vector.clear();
    }
    vectorFrom.clear();
    vector.clear();
}
Also used : RepeatedListVector(org.apache.drill.exec.vector.complex.RepeatedListVector) ListVector(org.apache.drill.exec.vector.complex.ListVector) MaterializedField(org.apache.drill.exec.record.MaterializedField) ExecTest(org.apache.drill.exec.ExecTest) Test(org.junit.Test)

Aggregations

ExecTest (org.apache.drill.exec.ExecTest)1 MaterializedField (org.apache.drill.exec.record.MaterializedField)1 ListVector (org.apache.drill.exec.vector.complex.ListVector)1 RepeatedListVector (org.apache.drill.exec.vector.complex.RepeatedListVector)1 Test (org.junit.Test)1