How is the job configured? Are the TableMapReduceUtil static methods used or is it done by hand?
This might be missing: job.setOutputValueClass(Put.class) - Andy ________________________________ From: stack <[email protected]> To: [email protected] Sent: Saturday, July 25, 2009 9:08:01 AM Subject: Re: Pass a Delete or a Put Hmm... That should work. Here is code from TOF: public void write(KEY key, Writable value) throws IOException { if (value instanceof Put) this.table.put(new Put((Put)value)); else if (value instanceof Delete) this.table.delete(new Delete((Delete)value)); else throw new IOException("Pass a Delete or a Put"); } Maybe change the IOE... to something like: else throw new IOException("Pass a Delete or a Put rather than a " + value); ...compile and retry. Whats the exception look like? We're squashing the type somehow or else context.write and TOF#RecordWriter#write are not properly hooked up. Thanks Travis, St.Ack On Sat, Jul 25, 2009 at 7:14 AM, Hegner, Travis <[email protected]>wrote: > Hi All, > > I am getting the "Pass a Delete or a Put" exception from my reducer tasks > (TableOutputFormat.java:96), even though I am actually passing a put... > > for(int i = 0; i < idList.size(); i++) { > Put thisput = new > Put(key.toString().getBytes()); > thisput.add("Positions".getBytes(), > idList.get(i).toString().getBytes(), posList.get(i).toString().getBytes()); > context.write(key, thisput); > } > > Is there anything wrong with this section of code from my reduce()? > > I have also tried casting the value with: > > context.write(key, (Put)thisput); > > Any Ideas? > > Travis Hegner > http://www.travishegner.com/ > > The information contained in this communication is confidential and is > intended only for the use of the named recipient. Unauthorized use, > disclosure, or copying is strictly prohibited and may be unlawful. If you > have received this communication in error, you should know that you are > bound to confidentiality, and should please immediately notify the sender or > our IT Department at 866.459.4599. >
