title: hadoop textinputformat read only one line per file
body: <p>I wrote a simple map task for hadoop 0.20.2, the input dataset consists of 44 files, each is about 3-5MB. Each line of any file has the format <code>int,int</code>. The input format is the default <code>TextInputFormat</code> and the mapper's work is to parse the input <code>Text</code> into the integers.</p>
  
  <p>After the task run, the statistics of hadoop framework shew that the number of input records for map task is just 44. I tried debug and found that the input records for the method <code>map</code> are just the first line of each file.</p>
  
  <p>Does anyone know what the problem is and where can I find the solution?</p>
  
  <p>Thank you in advanced.</p>
  
  <p><strong>Edit 1</strong></p>
  
  <p>The input data were generated by a different map-reduce task whose output format is <code>TextOutputFormat&lt;NullWritable, IntXInt&gt;</code>. The <code>toString()</code> method of <code>IntXInt</code> should give a string of <code>int,int</code>.</p>
  
  <p><strong>Edit 2</strong></p>
  
  <p>My mapper looks like the following</p>
  
  <pre><code>static class MyMapper extends MapReduceBas
    implements Mapper&lt;LongWritable, Text, IntWritable, IntWritable&gt; {
  
    public void map(LongWritable key,
                    Text value,
                    OutputCollector&lt;IntWritable, IntWritable&gt; output,
                    Reporter reporter) {
  
      String[] s = value.toString().split(",");
      IntXInt x = new IntXInt(s[0], s[1]);
      output.collect(x.firstInt(), x.secondInt());
    }
  }
  </code></pre>
  
  <p><strong>Edit 3</strong></p>
  
  <p>I have just checked, the mapper actually reads only 1 line for each file, NOT the whole file as one <code>Text</code> value.</p>