Professional Documents
Culture Documents
2. then create a hive external table and load the csv file
a. CREATE EXTERNAL TABLE IF NOT EXISTS product_external(id int, item string,fullname
string, quantity int, price int,item_type string)
b. ROW FORMAT DELIMITED
c. FIELDS TERMINATED BY ','
d. STORED AS TEXTFILE
e. LOCATION '/tmp/product';
3. Then lets load data into external hive table
a. LOAD DATA INPATH '/tmp/lab/product.csv' overwrite INTO TABLE product_external
b. If you get an error saying failed to movetask - try selecting from table product_external
to see if it has loaded data – if it has move on as there could be an issue with the
sandbox
4. Then create a hive internal table
a. CREATE TABLE IF NOT EXISTS EXISTS product_ORC(id int, item string,fullname string,
quantity int, price int,item_type string) STORED AS ORC;
b. If you get an error – remove the redundant word 😊
Table definition :
9. From hive we insert records into Hbase table
a. INSERT INTO TABLE ext_hbase_product SELECT * FROM product_orc;
b. Select * from ext_hbase_table - screen print first page only
10. From Hbase
a. scan 'Product' - screen print the last page from hbase