[ 
https://issues.apache.org/jira/browse/HADOOP-5973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12796689#action_12796689
 ] 

Tom White commented on HADOOP-5973:
-----------------------------------

The "map.input.file" parameter is only available in 0.20.0 when using the old  
(deprecated) MapReduce API. In the new API the parameter is not set: the 
equivalent call is
{code}
((FileSplit) context.getInputSplit).getPath()
{code}

This is as designed, but I think we should update the documentation to explain 
this.

> "map.input.file" is not set
> ---------------------------
>
>                 Key: HADOOP-5973
>                 URL: https://issues.apache.org/jira/browse/HADOOP-5973
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: conf
>    Affects Versions: 0.20.0
>            Reporter: Rares Vernica
>            Priority: Minor
>
> Hadoop does not set the "map.input.file" variable. I tried the fallowing and 
> all I get is "null".
> public class Map extends Mapper<Object, Text, LongWritable, Text> {
>    public void map(Object key, Text value, Context context)
>            throws IOException, InterruptedException {
>        Configuration conf = context.getConfiguration();
>        System.out.println(conf.get("map.input.file"));
>    }
>    protected void setup(Context context) throws IOException,
>            InterruptedException {
>        Configuration conf = context.getConfiguration();
>        System.out.println(conf.get("map.input.file"));
>    }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to