if (Formats.AVRO.equals(format)) {
AvroKeyInputFormat<E> delegate = new AvroKeyInputFormat<E>();
return new KeyReaderWrapper(
delegate.createRecordReader(inputSplit, taskAttemptContext));
} else if (Formats.PARQUET.equals(format)) {
AvroParquetInputFormat delegate = new AvroParquetInputFormat();
return new ValueReaderWrapper(
delegate.createRecordReader(inputSplit, taskAttemptContext));
} else if (Formats.CSV.equals(format)) {
CSVInputFormat<E> delegate = new CSVInputFormat<E>();
delegate.setDescriptor(dataset.getDescriptor());
delegate.setType(dataset.getType());
return delegate.createRecordReader(inputSplit, taskAttemptContext);
} else {
throw new UnsupportedOperationException(
"Not a supported format: " + format);
}
}