/**
* This function is meant to be used if the mappers/reducers want to access
* any HDFS file
*/
public static InputStream openDFSFile(String fileName) throws IOException {
SliceWrapper wrapper = PigInputFormat.getActiveSplit();
if (wrapper == null)
throw new RuntimeException(
"can't open DFS file while executing locally");
return openDFSFile(fileName, ConfigurationUtil.toProperties(wrapper.getJobConf()));
}