CorcOutputFormat extends FileOutputFormat<NullWritable, Corc> { @Override public RecordWriter<NullWritable, Corc> getRecordWriter(FileSystem fileSystem, JobConf conf, String name, Progressable progress) throws IOException { String file = FileOutputFormat.getTaskOutputPath(conf, name).toString(); RecordWriter<NullWritable, ?> writer = orcOutputFormat.getRecordWriter(fileSystem, conf, file, progress); return new CorcRecordWriter(writer); }  @Override RecordWriter<NullWritable, Corc> getRecordWriter(FileSystem fileSystem, JobConf conf, String name,
      Progressable progress);  }
@Test public void writer() throws IOException { File root = temporaryFolder.getRoot(); conf.set("mapreduce.output.fileoutputformat.outputdir", root.getCanonicalPath()); conf.set("mapreduce.task.attempt.id", "attempt_x_0001_m_000001_1"); String name = "name"; RecordWriter<NullWritable, Corc> writer = outputFormat.getRecordWriter(fileSystem, conf, name, progress); StructTypeInfo typeInfo = new StructTypeInfoBuilder().add("a", TypeInfoFactory.stringTypeInfo).build(); Corc corc = new Corc(typeInfo, new DefaultConverterFactory()); corc.set("a", "value"); writer.write(NullWritable.get(), corc); writer.close(reporter); Path path = new Path(root.getCanonicalPath() + "/_temporary/0/_temporary/attempt_x_0001_m_000001_1/name"); try (OrcReader reader = new OrcReader(conf, path)) { List<Object> next = reader.next(); assertThat(next.size(), is(1)); assertThat(next.get(0), is((Object) "value")); assertFalse(reader.hasNext()); } ; }