title: Hadoop Mapreduce multiple Input files
body: <p>So I need two files as an Input to my mapreduce program: City.dat and Country.dat</p>
  
  <p>In my main method im parsing the command line arguments like this:</p>
  
  <pre><code>Path cityInputPath = new Path(args[0]);
  Path countryInputPath = new Path(args[1]);
  Path outputPath = new Path(args[2]);
  MultipleInputs.addInputPath(job, countryInputPath, TextInputFormat.class, JoinCountryMapper.class);
  MultipleInputs.addInputPath(job, cityInputPath, TextInputFormat.class, JoinCityMapper.class);
  FileOutputFormat.setOutputPath(job, outputPath);
  </code></pre>
  
  <p>If I'm now running my programm with the following command:</p>
  
  <pre><code>hadoop jar capital.jar org.myorg.Capital /user/cloudera/capital/input/City.dat /user/cloudera/capital/input/Country.dat /user/cloudera/capital/output
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>Exception in thread "main" org.apache.hadoop.mapred.FileAlreadyExistsException: Output directory /user/cloudera/capital/input/Country.dat already exists
  </code></pre>
  
  <p>Why does it treat this as my output directory? I specified another directory as the output directory. Can somebody explain this?</p>