Search in sources :

Example 1 with RepeatedFixedWidthVectorLike

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

the class BatchValidator method validateRepeatedVector.

private void validateRepeatedVector(String name, BaseRepeatedValueVector vector) {
    int dataLength = Integer.MAX_VALUE;
    if (vector instanceof RepeatedVarCharVector) {
        dataLength = ((RepeatedVarCharVector) vector).getOffsetVector().getValueCapacity();
    } else if (vector instanceof RepeatedFixedWidthVectorLike) {
        dataLength = ((BaseDataValueVector) ((BaseRepeatedValueVector) vector).getDataVector()).getBuffer().capacity();
    }
    int itemCount = validateOffsetVector(name + "-offsets", vector.getOffsetVector(), rowCount, dataLength);
    // Special handling of repeated VarChar vectors
    // The nested data vectors are not quite exactly like top-level vectors.
    @SuppressWarnings("resource") ValueVector dataVector = vector.getDataVector();
    if (dataVector instanceof VariableWidthVector) {
        validateVariableWidthVector(name + "-data", (VariableWidthVector) dataVector, itemCount);
    }
}
Also used : ValueVector(org.apache.drill.exec.vector.ValueVector) BaseRepeatedValueVector(org.apache.drill.exec.vector.complex.BaseRepeatedValueVector) BaseDataValueVector(org.apache.drill.exec.vector.BaseDataValueVector) RepeatedVarCharVector(org.apache.drill.exec.vector.RepeatedVarCharVector) RepeatedFixedWidthVectorLike(org.apache.drill.exec.vector.complex.RepeatedFixedWidthVectorLike) BaseRepeatedValueVector(org.apache.drill.exec.vector.complex.BaseRepeatedValueVector) VariableWidthVector(org.apache.drill.exec.vector.VariableWidthVector)

Aggregations

BaseDataValueVector (org.apache.drill.exec.vector.BaseDataValueVector)1 RepeatedVarCharVector (org.apache.drill.exec.vector.RepeatedVarCharVector)1 ValueVector (org.apache.drill.exec.vector.ValueVector)1 VariableWidthVector (org.apache.drill.exec.vector.VariableWidthVector)1 BaseRepeatedValueVector (org.apache.drill.exec.vector.complex.BaseRepeatedValueVector)1 RepeatedFixedWidthVectorLike (org.apache.drill.exec.vector.complex.RepeatedFixedWidthVectorLike)1