Create LineItems Hive table Step 1: Create a file “line-item1.txt” on HDFS under “/user/cloudera/learn-hdfs/lineitems” as
1 2 3 4 |
123,Pen 456,Pencil |
Step 2: You create a Hive table “lineitems” in the database “learnhadoop”.
1 2 3 4 5 6 7 8 9 |
CREATE EXTERNAL TABLE IF NOT EXISTS learnhadoop.lineitems ( order_id int ,product_name string ) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' LOCATION 'hdfs:////user/cloudera/learn-hdfs/lineitems'; |
Step 3: The “orders” table can be created in a similar…