public void init(List<KeyValuesReader> readerList) {
      for (int i = 0; i < readerList.size(); i++) {
        readerArray[i] = null;
      }
      loadedSize = 0;
      for (KeyValuesReader kvsReader : readerList) {
        readerArray[loadedSize] = kvsReader;
        loadedSize++;
      }
      currentIterator = null;
      currentIndex = 0;
    }
A KeyValuesReader implementation that returns a sorted stream of key-values
by doing a sorted merge of the key-value in LogicalInputs.
Tags are in the last byte of the key, so no special handling for tags is required.
Uses a priority queue to pick the KeyValuesReader of the input that is next in
sort order.
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/tools/KeyValuesInputMerger.java