}
}
@Override
public Object next(Object previous) throws IOException {
OrcStruct result = null;
if (valuePresent) {
if (previous == null) {
result = new OrcStruct(fieldNames);
} else {
result = (OrcStruct) previous;
// If the input format was initialized with a file with a
// different number of fields, the number of fields needs to
// be updated to the correct number
result.setFieldNames(fieldNames);
}
for(int i=0; i < fields.length; ++i) {
if (fields[i] != null) {
result.setFieldValue(i,
fields[i].getInComplexType(result.getFieldValue(i), previousRow));
}
}
}
return result;
}