Search in sources :

Example 1 with RepeatedListVector

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

the class TestValueVector method testVectors.

/**
   * Convenience method that allows running tests on various {@link ValueVector vector} instances.
   *
   * @param test test function to execute
   */
private void testVectors(VectorVerifier test) throws Exception {
    final MaterializedField[] fields = { MaterializedField.create(EMPTY_SCHEMA_PATH, UInt4Holder.TYPE), MaterializedField.create(EMPTY_SCHEMA_PATH, BitHolder.TYPE), MaterializedField.create(EMPTY_SCHEMA_PATH, VarCharHolder.TYPE), MaterializedField.create(EMPTY_SCHEMA_PATH, NullableVarCharHolder.TYPE), MaterializedField.create(EMPTY_SCHEMA_PATH, RepeatedListVector.TYPE), MaterializedField.create(EMPTY_SCHEMA_PATH, MapVector.TYPE), MaterializedField.create(EMPTY_SCHEMA_PATH, RepeatedMapVector.TYPE) };
    final ValueVector[] vectors = { new UInt4Vector(fields[0], allocator), new BitVector(fields[1], allocator), new VarCharVector(fields[2], allocator), new NullableVarCharVector(fields[3], allocator), new RepeatedListVector(fields[4], allocator, null), new MapVector(fields[5], allocator, null), new RepeatedMapVector(fields[6], allocator, null) };
    try {
        for (final ValueVector vector : vectors) {
            test.verify(vector);
        }
    } finally {
        AutoCloseables.close(vectors);
    }
}
Also used : ValueVector(org.apache.drill.exec.vector.ValueVector) BaseValueVector(org.apache.drill.exec.vector.BaseValueVector) BitVector(org.apache.drill.exec.vector.BitVector) NullableVarCharVector(org.apache.drill.exec.vector.NullableVarCharVector) RepeatedListVector(org.apache.drill.exec.vector.complex.RepeatedListVector) RepeatedMapVector(org.apache.drill.exec.vector.complex.RepeatedMapVector) NullableVarCharVector(org.apache.drill.exec.vector.NullableVarCharVector) VarCharVector(org.apache.drill.exec.vector.VarCharVector) MaterializedField(org.apache.drill.exec.record.MaterializedField) NullableUInt4Vector(org.apache.drill.exec.vector.NullableUInt4Vector) UInt4Vector(org.apache.drill.exec.vector.UInt4Vector) RepeatedMapVector(org.apache.drill.exec.vector.complex.RepeatedMapVector) MapVector(org.apache.drill.exec.vector.complex.MapVector)

Aggregations

MaterializedField (org.apache.drill.exec.record.MaterializedField)1 BaseValueVector (org.apache.drill.exec.vector.BaseValueVector)1 BitVector (org.apache.drill.exec.vector.BitVector)1 NullableUInt4Vector (org.apache.drill.exec.vector.NullableUInt4Vector)1 NullableVarCharVector (org.apache.drill.exec.vector.NullableVarCharVector)1 UInt4Vector (org.apache.drill.exec.vector.UInt4Vector)1 ValueVector (org.apache.drill.exec.vector.ValueVector)1 VarCharVector (org.apache.drill.exec.vector.VarCharVector)1 MapVector (org.apache.drill.exec.vector.complex.MapVector)1 RepeatedListVector (org.apache.drill.exec.vector.complex.RepeatedListVector)1 RepeatedMapVector (org.apache.drill.exec.vector.complex.RepeatedMapVector)1