Look at WordCount.java in src/examples/org/apache/hadoop/examples. Whether you need a new InputFormat depends on what you want to do.
Amar
On Fri, 7 Mar 2008, Prasan Ary wrote:

 Hi All,
 I am running a Map/Reduce on a textfile.
 Map takes <Text,Text> as (key,value) input pair , and outputs 
<Text,IntWritable> as (key,value) output pair.

 Reduce takes <Text,IntWritable> as (key,value) input pair, and outputs 
<Text,Text> as (key,value) output pair.

 I am getting a type mismatch error.

 Any suggestion?


 JobConf job = new JobConf(..............

 job.setOutputKeyClass(Text.class);
 job.setOutputValueClass(Text.class);

 -----------------------------
 public static class Map extends MapReduceBase implements Mapper<Text, Text, Text, 
IntWritable> {
   ......
   public void map(Text key, Text value, OutputCollector<Text, IntWritable> 
output, Reporter reporter) throws IOException { ......

 output.collect(key,new IntWritable(1));

 ----------------------------

 public static class Reduce extends MapReduceBase implements Reducer<Text, 
IntWritable, Text, Text> {
 public void reduce(Text key, Iterator<IntWritable> values, 
OutputCollector<Text,Text> output, Reporter reporter) throws IOException {  
..............

 output.collect(key, new Text("SomeText");


---------------------------------
Never miss a thing.   Make Yahoo your homepage.

Reply via email to