@Override
public RecordReader<NullWritable, OrcLazyRow>
getRecordReader(InputSplit inputSplit, JobConf conf,
Reporter reporter) throws IOException {
ReaderWriterProfiler.setProfilerOptions(conf);
FileSplit fileSplit = (FileSplit) inputSplit;
Path path = fileSplit.getPath();
FileSystem fs = path.getFileSystem(conf);
reporter.setStatus(fileSplit.toString());
try {
return new OrcRecordReader(
OrcFile.createReader(fs, path, conf),
conf,
fileSplit.getStart(),
fileSplit.getLength());
} catch (IndexOutOfBoundsException e) {
/**
* When a non ORC file is read by ORC reader, we get IndexOutOfBoundsException exception while
* creating a reader. Caught that exception and checked the file header to see if the input
* file was ORC or not. If its not ORC, throw a NotAnORCFileException with the file