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
Use this inside your mapper :
FileSplit fileSplit = (FileSplit)context.getInputSplit();
String filename = fileSplit.getPath().getName();
Edit :
Try this if you want to do it inside configure() through the old API :
String fileName = new String();
public void configure(JobConf job)
{
filename = job.get("map.input.file");
}