@Override
    public void next(OrcStruct next) throws IOException {
      if (getRecordReader().hasNext()) {
        nextRecord = (OrcStruct) getRecordReader().next(next);
        // set the key
        getKey().setValues(OrcRecordUpdater.getOriginalTransaction(nextRecord()),
            OrcRecordUpdater.getBucket(nextRecord()),
            OrcRecordUpdater.getRowId(nextRecord()),
            OrcRecordUpdater.getCurrentTransaction(nextRecord()),
            OrcRecordUpdater.getOperation(nextRecord()) == OrcRecordUpdater.DELETE_OPERATION);
        // if this record is larger than maxKey, we need to stop
        if (getMaxKey() != null && getKey().compareRow(getMaxKey()) > 0) {
          LOG.debug("key " + getKey() + " > maxkey " + getMaxKey());
          nextRecord = null;
          getRecordReader().close();
        }
      } else {
        nextRecord = null;
        getRecordReader().close();
      }
    }
Create a reader that reads from the first key larger than minKey to any
keys equal to maxKey.
@param key the key to read into
@param reader the ORC file reader
@param minKey only return keys larger than minKey if it is non-null
@param maxKey only return keys less than or equal to maxKey if it is
              non-null
@param options options to provide to read the rows.
@param conf
@throws IOException
ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcRawRecordMerger.java