You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by yonghu <yo...@gmail.com> on 2014/11/21 13:54:21 UTC

Is it possible to get the table name at the Map phase?

Hello all,

I want to implement difference operator by using MapReduce. I read two
tables by using MultiTableInputFormat. In the Map phase, I need to tag the
name of table into each row, but how can I get the table name?

One way I can think is to create HTable instance for each table in the
setup() function. And in the map function, call get method to check if the
input row is belonged to table_1 or table_2. However, this approach is slow.

Can someone share some different ideas?

regards!

Yong

Re: Is it possible to get the table name at the Map phase?

Posted by Ted Yu <yu...@gmail.com>.
This question has been asked a few times.

Take a look at Nick's comment in HBASE-4587

Cheers

On Fri, Nov 21, 2014 at 4:54 AM, yonghu <yo...@gmail.com> wrote:

> Hello all,
>
> I want to implement difference operator by using MapReduce. I read two
> tables by using MultiTableInputFormat. In the Map phase, I need to tag the
> name of table into each row, but how can I get the table name?
>
> One way I can think is to create HTable instance for each table in the
> setup() function. And in the map function, call get method to check if the
> input row is belonged to table_1 or table_2. However, this approach is
> slow.
>
> Can someone share some different ideas?
>
> regards!
>
> Yong
>