use of org.apache.drill.exec.vector.complex.RepeatedValueVector in project drill by apache.
the class UnnestRecordBatch method setUnnestVector.
private void setUnnestVector() {
MaterializedField field = incoming.getSchema().getColumn(unnestTypedFieldId.getFieldIds()[0]);
RepeatedValueVector vector;
ValueVector inVV = incoming.getValueAccessorById(field.getValueClass(), unnestTypedFieldId.getFieldIds()).getValueVector();
if (!(inVV instanceof RepeatedValueVector)) {
if (incoming.getRecordCount() != 0) {
throw UserException.unsupportedError().message("Unnest does not support inputs of non-list values.").build(logger);
}
// Inherited from FLATTEN. When does this happen???
// when incoming recordCount is 0, don't throw exception since the type being seen here is not solid
logger.error("setUnnestVector cast failed and recordcount is 0, create empty vector anyway.");
vector = new RepeatedMapVector(field, oContext.getAllocator(), null);
} else {
vector = RepeatedValueVector.class.cast(inVV);
}
unnest.setUnnestField(vector);
}
Aggregations