Uploaded image for project: 'Hadoop Map/Reduce'
  1. Hadoop Map/Reduce
  2. MAPREDUCE-1743

conf.get("map.input.file") returns null when using MultipleInputs in Hadoop 0.20

Add voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.20.2
    • None
    • None
    • None

    Description

      There is a problem in getting the input file name in the mapper when uisng MultipleInputs in Hadoop 0.20. 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); ........................................... }

      }

      Attachments

        1. mr-1743.diff
          2 kB
          Liyin Liang

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            liangly Liyin Liang
            humming80 Yuanyuan Tian

            Dates

              Created:
              Updated:

              Slack

                Issue deployment