Migrating data to a hive in hbase

Description: the original data is stored in the hbase, but direct access hbase slow (hbase wide-table structure), so that the hive wants to migrate data;

1. First hbase hive and create external links table can be queried directly in the hive;

2. The tables created by the external, internal table created directly in the hive;

Directly on the code:

# Create a hive external table links 
the CREATE
the EXTERNAL TABLE hbase_table_hive3 ( Key String, field name Double ) STORED BY ' org.apache.hadoop.hive.hbase.HBaseStorageHandler ' the WITH SERDEPROPERTIES ( "hbase.columns.mapping" = ": Key , the Data: field name ") TBLPROPERTIES (" HBase. the table .name " = " table_name "); # create a table inside the hive the create the table table_name AS the SELECT * from hbase_table_hive3;
# delete the middle of the table
drop the table hbase_table_hive3;

 

Guess you like

Origin www.cnblogs.com/smars1990/p/11539677.html