Vikram Singh Chandel
Vikram Singh Chandel

Reputation: 633

Should I use PIG to load data into HBase from HIVE or is there a better way?

I have to load data into HBase table from HIVE. I know that there are various ways to do this, for example:

Can you please guide me by recommending the best approach to follow?

We are not using phoenix for this use case.

Upvotes: 0

Views: 551

Answers (1)

Remus Rusanu
Remus Rusanu

Reputation: 294417

You can use HBASE integration:

CREATE TABLE hbase_table_1(key int, value string) 
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,cf1:val")
TBLPROPERTIES ("hbase.table.name" = "xyz");

then load your data into the Hive table, will also load HBase since is the same table.

Upvotes: 1

Related Questions