On Wed, Jul 8, 2009 at 21:06, stack <[email protected]> wrote:

> Text keys were deprecated a good while ago.  Keys and values are byte
> arrays
> in hbase.  If you want the key to be Text, add the Text bytes and then make
> a new Text on fetching.
>
> The new mapreduce package -- as opposed to mapred following our parent's
> model -- has new MR classes but TableMapper (sic) does
> ImmutableBytesWritable as key, a Writable to wrap the table byte array key.
>

I think he is talking about outputting Text keys from a map (i.e. making
KEYOUT a text). You can't do that in hbase 0.20's mapred because TableMap is
defined like this:

public interface TableMap<K extends WritableComparable<K>, V extends
Writable>
extends Mapper<ImmutableBytesWritable, RowResult, K, V>

While Text looks like this:

public class Text implements WritableComparable<BinaryComparable> ......

however, TableMap requires Text to implement WritableComparable<Text> .

Anyway, one solution may be to simply copy Text into your own code base and
make
it implement WritableComparable<Text> (and move some methods from
BinaryComparable to your Text).


>
> St.Ack
>
>
> On Wed, Jul 8, 2009 at 7:43 AM, Yair Even-Zohar
> <[email protected]>wrote:
>
> > I'm trying to import my 0.19 code to 0.20 and am running into a problem
> > using the TableMap interface.
> >
> > It seems like I can not construct table key of Text class and read a
> > table using TableMap because of the comperator differences.
> >
> >
> >
> > Has anybody run into this problem and if so, what is the suggested
> > solution?
> >
> >
> >
> > Thanks
> >
> > -Yair
> >
> >
>



-- 
Doğacan Güney

Reply via email to