@Override
  public Object next(Object previous) throws IOException {
    if (!ensureBatch()) {
      return null;
    }
    if (schema.getCategory() == TypeDescription.Category.STRUCT) {
      OrcStruct result;
      List<TypeDescription> children = schema.getChildren();
      int numberOfChildren = children.size();
      if (previous == null || previous.getClass() != OrcStruct.class) {
        result = new OrcStruct(numberOfChildren);
        previous = result;
      } else {
        result = (OrcStruct) previous;
        if (result.getNumFields() != numberOfChildren) {
          result.setNumFields(numberOfChildren);
        }
      }
      for(int i=0; i < numberOfChildren; ++i) {
        result.setFieldValue(i, nextValue(batch.cols[i], rowInBatch,
            children.get(i), result.getFieldValue(i)));
      }
    } else {
      previous = nextValue(batch.cols[0], rowInBatch, schema, previous);
    }
    rowInBatch += 1;
    return previous;
  }
If the current batch is empty, get a new one.
@return true if we have rows available.
@throws IOException
ql/src/java/org/apache/hadoop/hive/ql/io/orc/RecordReaderImpl.java