How I can get the name of the input file within a mapper? I have multiple input files stored in the input directory, each mapper may read a different file, and I need to kno
For org.apache.hadood.mapred package the map function signature should be:
org.apache.hadood.mapred
map(Object, Object, OutputCollector, Reporter)
So, to get the file name inside the map function, you could use the Reporter object like this:
String fileName = ((FileSplit) reporter.getInputSplit()).getPath().getName();