private Writer setupWriter(Reader reader, Path outPath) throws IOException {
    OrcFile.WriterOptions options =
            OrcFile.writerOptions(conf).compress(reader.getCompression()).version(reader.getFileVersion())
                    .rowIndexStride(reader.getRowIndexStride()).inspector(reader.getObjectInspector());
    if (CompressionKind.NONE != reader.getCompression()) {
      options.bufferSize(reader.getCompressionSize()).enforceBufferSize();
    }
    Writer writer = OrcFile.createWriter(outPath, options);
    LOG.info("ORC merge file output path: {}", outPath);
    return writer;
  }
Create a new instance of orc output writer. The writer parameters are collected from the orc reader.
@param reader orc reader of file
@param outPath the path of the output file
@return a new instance of orc writer, always non-null
@throws IOException error during file operation
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/OrcFileMerger.java