Re: Question about open table

2016-04-09 Thread Ted Yu
Can you show the body of getConnection() ?

getTable() itself is not expensive - assuming the same underlying
Connection.

Cheers

On Sat, Apr 9, 2016 at 7:18 AM, Yi Jiang  wrote:

> Hi, Guys
> I just have a question, I am trying to save the data into table in HBase
> I am using
>
> Table table = getConnection().getTable(TableName.valueOf(tableName));
> ...
> ...
> Table.close
>
> My question is that, is the "getTable" expensive?
> Shall I use that get table and close table in each saving?
> Or I just get table at the beginning, saving all data and then close the
> table after all saving.
> Because from the aspect of code design, I will save data into the
> different table on the flying. So, if it is expensive, I would like to
> rewrite the design.
> Thank you
> Jacky
>


Question about open table

2016-04-09 Thread Yi Jiang
Hi, Guys
I just have a question, I am trying to save the data into table in HBase
I am using

Table table = getConnection().getTable(TableName.valueOf(tableName));
...
...
Table.close

My question is that, is the "getTable" expensive?
Shall I use that get table and close table in each saving?
Or I just get table at the beginning, saving all data and then close the table 
after all saving.
Because from the aspect of code design, I will save data into the different 
table on the flying. So, if it is expensive, I would like to rewrite the design.
Thank you
Jacky


Re: Column qualifier name in byte array in hbase

2016-04-09 Thread Ted Yu
I guess you have read:
https://cwiki.apache.org/confluence/display/Hive/HBaseIntegration#HBaseIntegration-HiveMAPtoHBaseColumnFamily

where example for column family mapping is given.

If you need to map column qualifier, probably poll hive mailing list on
syntax.

FYI

On Sat, Apr 9, 2016 at 12:30 AM, Viswanathan J 
wrote:

> Hi,
>
> I'm trying to create external hive table to map hbase table and i'm facing
> issue in the column mapping because the column qualifier is in byte array
> as below, how to define/map this.
>
> eg.,
>
> column=cf:\x00\x00\x00\x00\x00\x00\x00\x00, timestamp=1455990558044
>
> --
> Regards,
> Viswa.J
>