use of org.apache.drill.exec.vector.complex.BaseRepeatedValueVector 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);
}
}
use of org.apache.drill.exec.vector.complex.BaseRepeatedValueVector in project drill by apache.
the class BatchValidator method validateRepeatedVector.
private void validateRepeatedVector(String name, BaseRepeatedValueVector vector) {
ValueVector dataVector = vector.getDataVector();
int dataLength = dataVector.getAccessor().getValueCount();
int valueCount = vector.getAccessor().getValueCount();
int itemCount = validateOffsetVector(name + "-offsets", vector.getOffsetVector(), valueCount, dataLength);
if (dataLength != itemCount) {
error(name, vector, String.format("Data vector has %d values, but offset vector has %d values", dataLength, itemCount));
}
// Special handling of repeated VarChar vectors
// The nested data vectors are not quite exactly like top-level vectors.
validateVector(name + "-data", dataVector);
}
Aggregations