Example 7 – Hive HBase integration

Now, we will access the HBase customer table using the Hive external table:

create external table customer_hbase(cust_id string, cust_name string, cust_city string, InsUpd_on string)STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'with serdeproperties ("hbase.columns.mapping"=":key,cf1:cust_name,cf1:cust_city,cf1:InsUpd_on")tblproperties("hbase.table.name"="customer");hive> select * from customer_hbase;OK1 Sam James Austin 150509503010 Mark Fisher Mil Valley 150509504411 Mark Fisher Mil Valley 150509504412 Jane Turner Glen Park 15050950752 Peter Carter Denver 15050950303 Doug Smith Sunnyvale 15050950304 Harry Warner Dublin 15050950655 Jen Turner Cupertino 15050950366 Emily Stone Walnut Creek 1505095038 ...

Get Modern Big Data Processing with Hadoop now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.