hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom White <...@cloudera.com>
Subject Re: conf.get("map.input.file") returns null when using MultipleInputs in Hadoop 0.20
Date Thu, 29 Apr 2010 16:41:04 GMT
Hi Yuanyuan,

I think you've found a bug - could you file a JIRA issue for this please?

Thanks,
Tom

On Wed, Apr 28, 2010 at 11:04 PM, Yuanyuan Tian <ytian@us.ibm.com> wrote:
>
>
> I have a problem in getting the input file name in the mapper  when uisng
> MultipleInputs. I need to use MultipleInputs to support different formats
> for my inputs to the my MapReduce job. And inside each mapper, I also need
> to know the exact input file that the mapper is processing. However,
> conf.get("map.input.file") returns null. Can anybody help me solve this
> problem? Thanks in advance.
>
> public class Test extends Configured implements Tool{
>
>        static class InnerMapper extends MapReduceBase implements
> Mapper<Writable, Writable, NullWritable, Text>
>        {
>                ................
>                ................
>
>                public void configure(JobConf conf)
>                {
>                        String inputName=conf.get("map.input.file"));
>                        .......................................
>                }
>
>        }
>
>        public int run(String[] arg0) throws Exception {
>                JonConf job;
>                job = new JobConf(Test.class);
>                ...........................................
>
>                MultipleInputs.addInputPath(conf, new Path("A"),
> TextInputFormat.class);
>                MultipleInputs.addInputPath(conf, new Path("B"),
> SequenceFileFormat.class);
>                ...........................................
>        }
> }
>
> Yuanyuan

Mime
View raw message