@ Override public RecordWriter getRecordWriter ( TaskAttemptContext taskAttemptContext ) throws IOException { Configuration conf = taskAttemptContext . getConfiguration ( ) ; String extension = "." + conf . get ( COMPACTION_OUTPUT_EXTENSION , "orc" ) ; Path filename = getDefaultWorkFile ( taskAttemptContext , extension ) ; Writer writer = OrcFile . createWriter ( filename , org . apache . orc . mapred . OrcOutputFormat . buildOptions ( conf ) ) ; return new OrcMapreduceRecordWriter ( writer ) ; }
Required for extension since super method hard - coded file extension as . orc . To keep flexibility of extension name we made it configuration driven .