public List<BaseWork> getMergeWorkList(final JobConf jconf, String key, String queryId,
      ObjectCache cache, List<String> cacheKeys) throws HiveException {
    String prefixes = jconf.get(DagUtils.TEZ_MERGE_WORK_FILE_PREFIXES);
    if (prefixes != null) {
      List<BaseWork> mergeWorkList = new ArrayList<>();

      for (final String prefix : prefixes.split(",")) {
        if (prefix.isEmpty()) {
          continue;
        }

        key = prefix;
        cacheKeys.add(key);

        mergeWorkList.add(cache.retrieve(key, () -> Utilities.getMergeWork(jconf, prefix)));
      }

      return mergeWorkList;
    } else {
      return null;
    }
  }
start processing the inputs and writing output
@throws Exception
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/RecordProcessor.java