title: Writing output to different folders hadoop
body: <ol>
  <li>I want  to write two different types of output from the same reducer, into two different directories.</li>
  </ol>
  
  <p>I am able to use multipleoutputs feature in hadoop to write to different files, but they both go to the same output folder.</p>
  
  <p>I want to write each file from the same reduce to a different folder.</p>
  
  <p>Is there a way for doing this?</p>
  
  <p>If I try putting for example "hello/testfile", as the second argument, it shows invaid argument. So I m not able to write to different folders.</p>
  
  <ol>
  <li>If the above case is not possible, the is it possible for the mapper to read only specific files from an input folder?</li>
  </ol>
  
  <p>Please help me.</p>
  
  <p>Thanks in advance!</p>
  
  <hr>
  
  <p>Thanks for the reply. I am able to read a file successfully using then above method. But in distributed mode, I am not able to do so.  In the reducer, I have 
  set:                        </p>
  
  <p><code>mos.getCollector("data", reporter).collect(new Text(str_key), new Text(str_val));</code> </p>
  
  <p>(Using multiple outputs, and in Job Conf: 
  I tried using </p>
  
  <p><code>FileInputFormat.setInputPaths(conf2, "/home/users/mlakshm/opchk285/data-r-00000*");</code> </p>
  
  <p>as well as </p>
  
  <p><code>FileInputFormat.setInputPaths(conf2, "/home/users/mlakshm/opchk285/data*");</code></p>
  
  <p>But, it gives the following error:  </p>
  
  <pre><code>cause:org.apache.hadoop.mapred.InvalidInputException: Input Pattern hdfs://mentat.cluster:54310/home/users/mlakshm/opchk295/data-r-00000* matches 0 files
  </code></pre>