private void closeReader() {
    if (!(reader instanceof MRReader)) {
      LOG.warn("Cannot close " + (reader == null ? null : reader.getClass()));
      return;
    }
    if (reader instanceof KeyValueInputMerger) {
      // cleanup
      KeyValueInputMerger kvMerger = (KeyValueInputMerger) reader;
      kvMerger.clean();
    }

    LOG.info("Closing MRReader on error");
    MRReader mrReader = (MRReader)reader;
    try {
      mrReader.close();
    } catch (IOException ex) {
      LOG.error("Failed to close the reader; ignoring", ex);
    }
  }
Process input from tez LogicalInput and write output - for a map plan Just pump the records
through the query plan.
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/MapRecordSource.java