@Override
    public void write(Writable key, Writable value) throws IOException, InterruptedException {
      Text _key = (Text) key;
      KeyValue _value = (KeyValue) value;
      String alias = new String(_key.getBytes(), 0, _key.getLength());
      BaseRecordWriterContainer baseRWContainer = baseRecordWriters.get(alias);
      if (baseRWContainer == null) {
        throw new IllegalArgumentException("OutputFormat with alias " + alias
            + " has not been added");
      }
      baseRWContainer.getRecordWriter().write(_value.getKey(), _value.getValue());
    }
Configure the job with the multiple output formats added. This method
should be called after all the output formats have been added and
configured and before the job submission.
hcatalog/core/src/main/java/org/apache/hive/hcatalog/mapreduce/MultiOutputFormat.java