Reputation: 53
When I use the below lines in map class:
String fileName = ((FileSplit) context.getInputSplit()).getPath().getName();
System.out.println(fileName);
I got an empty output file. Also, the last two lines in console are:
14/05/06 12:52:53 INFO mapred.JobClient: Map output records=0
14/05/06 12:52:53 INFO mapred.JobClient: SPLIT_RAW_BYTES=2127
Upvotes: 2
Views: 67
Reputation: 3359
The problem is with the System.out.println()
, you will not get the result in the console. You need to check your logs.
Or much easier: use a logger !
Import classes needed for logging
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Define the logger
private static final Log LOG = LogFactory.getLog(MyClass.class);
Log all what you need
LOG.info(fileName);
You will get the results during the job execution in the console.
Upvotes: 1