Study the mapreduce examples in unit tests or under our mapreduce package. Below looks fine to me. Maybe its how the job is configured.
St.Ack P.S. you don't have to find our src in random locations; e.g. our paul smiths' apache home dir. Our src is here: hbase.org St.Ack On Fri, Jul 29, 2011 at 8:53 AM, Narayanan K <[email protected]> wrote: > Hi Stack/Suraj, > > I tried my MR code on HBase to 0.90.x version. > > But I am getting the same exception after the Map stage is complete: > *java.io.IOException: > Pass a Delete or a Put*. > > I did a search on web and found the *TableOutputFormat* source code where > the *write* method is throwing the "*Pass a Delete or Put*" error: > http://people.apache.org/~psmith/hbase/sandbox/hbase/hbase-core/cobertura/org.apache.hadoop.hbase.mapreduce.TableOutputFormat.html > (Line 92-96) > > From this, I understand that the value in Reduce Output key,value pair > should be an instance of Put or Delete. > > My Reduce is also throwing an instance of Put : > > public static class Reducer1 extends TableReducer<Text, IntArrayWritable, > Text> > { > public void reduce(Text key, Iterator <IntArrayWritable> values, > Context context) > throws IOException, InterruptedException > { > .... > .... > Put put = new Put(rowid.getBytes()); > put.add(Bytes.toBytes("cf"), Bytes.toBytes("stats"), > Bytes.toBytes(val)); > context.write(new Text(rowid), put); > } > } > > Then why am I getting this exception *java.io.IOException: Pass a Delete or > a Put*? > > Any insights into what I am missing here would be really helpful. > > Thanks, > Narayanan > > > > > > On Wed, Jul 27, 2011 at 12:07 AM, Suraj Varma <[email protected]> wrote: > >> I found this older thread that _might_ help you ... but as Stack says, >> better to upgrade to 0.90.x if possible. >> >> http://search-hadoop.com/m/egk1n1T1Sw8/java.io.IOException%253A+Pass+a+Delete+or+a+Put&subj=Re+Type+mismatch >> >> --Suraj >> >> On Tue, Jul 26, 2011 at 11:25 AM, Stack <[email protected]> wrote: >> > On Tue, Jul 26, 2011 at 10:44 AM, Narayanan K <[email protected]> >> wrote: >> >> Hi Everyone, >> >> >> >> I have been trying to run a mapreduce on HBase 0.20.2 - Source and Sink >> both >> >> being HBase Tables. >> >> >> > >> > Please upgrade. Its hard to help you when you run a version so old. >> > None of us remember how it works. At least retry with 0.20.6. Better >> > still, move to 0.90.x. >> > St.Ack >> > >> >
