You are emitting a Text type. Try just passing 'row' to the context, the one passed in to your map. St.Ack
On Thu, Feb 3, 2011 at 12:23 PM, Mark Kerzner <[email protected]> wrote: > Hi, > > I have this code to read and write to HBase from MR, and it works fine with > 0 reducers, but it gives a type mismatch error when with 1 reducer. What > should I look at? *Thank you!* > > *Code:* > > static class RowCounterMapper > extends TableMapper<Text, IntWritable> { > > private static enum Counters { > > ROWS > } > > @Override > public void map(ImmutableBytesWritable row, Result values, Context > context) > throws IOException, InterruptedException { > for (KeyValue value : values.list()) { > if (value.getValue().length > 0) { > Text key = new Text(value.getValue()); > context.write(key, ONE); > } > } > } > } > > *Error: * > > java.io.IOException: Type mismatch in key from map: expected > org.apache.hadoop.hbase.io.ImmutableBytesWritable, recieved > org.apache.hadoop.io.Text >
