0% found this document useful (0 votes)
54 views1 page

HBase Setup for Data Engineers

The document contains commands to create HBase tables called "production_category" and "user_location", load data from files into staging tables in Hive, and insert the data from the staging tables into the HBase tables. It loads product and user location data from files into Hive staging tables, then inserts this data into the corresponding HBase tables created earlier.

Uploaded by

Ram Guggul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views1 page

HBase Setup for Data Engineers

The document contains commands to create HBase tables called "production_category" and "user_location", load data from files into staging tables in Hive, and insert the data from the staging tables into the HBase tables. It loads product and user location data from files into Hive staging tables, then inserts this data into the corresponding HBase tables created earlier.

Uploaded by

Ram Guggul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

start-hbase.

sh
----------------------------------------------------------
create 'production_category', 'prod_details' | hbase shell
create 'user_location', 'user_details' | hbase shell

----------------------------------------------------------
CREATE TABLE prod_details_stg (
id STRING,
prod_id STRING,
category STRING
)
ROW FORMAT DELIMITED FILEDS TERMINATED BY ',';

CREATE TABLE user_location_stg (


id STRING,
user_id STRING,
city STRING,
state STRING
)
ROW FORMAT DELIMITED FILEDS TERMINATED BY ',';

LOAD DATA LOCAL INPATH '/home/acadgild/hive/data/hbase_data/prod_details.txt'


INTO TABLE prod_details_stg;

LOAD DATA LOCAL INPATH '/home/acadgild/hive/data/hbase_data/user_location.txt'


INTO TABLE user_location_stg;

INSERT OVERWRITE TABLE prod_details


SELECT * FROM prod_details_stg;

INSERT OVERWRITE TABLE user_location


SELECT * FROM user_location_stg;

You might also like