Question

Please Create a Hive table based on columns present in the csv file. Include the create...

Please Create a Hive table based on columns present in the csv file. Include the create table command and show the screen snapshot of table schema using describe <tablename> command. Please show output.

Region Country Item Type Sales Channel Order Priority Order Date Order ID Ship Date Units Sold Unit Price Unit Cost Total Revenue Total Cost Total Profit
Sub-Saharan Africa South Africa Fruits Offline M 7/27/2012 443368995 7/28/2012 1593 9.33 6.92 14862.69 11023.56 3839.13
Middle East and North Africa Morocco Clothes Online M 9/14/2013 667593514 10/19/2013 4611 109.28 35.84 503890.08 165258.24 338631.84
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution

create external table tablename
(region string,
country string,
item_type string,
sales_channel string,
order_priority string,
order_date date,
order_id int,
ship_date date,
units_sold int,
unit_price double,
unit_cost double,
total_revenue double,
total_cost double)
row format delimited fields terminated by',' stored as textfile location'/user/hive/tan/sales_hive_table' TBLPROPERTIES("skip.header.line.count"="1");

--

after TOtal_cost field there is another field which is not visible

using the

describe tablename;

you can view the schema

==

all the best

Add a comment
Know the answer?
Add Answer to:
Please Create a Hive table based on columns present in the csv file. Include the create...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Region Country Item Type Sales Channel Order Priority Order Date Order ID Ship Date Units Sold Unit Price...

    Region Country Item Type Sales Channel Order Priority Order Date Order ID Ship Date Units Sold Unit Price Unit Cost Total Revenue Total Cost Total Profit Asia Morocco Clothes Online M ######## 6.68E+08 ######## 4611 109.28 35.84 503890.1 165258.2 338631.8 Sub-Saharan Africa Ghana Office Supplies Online L ######## 6.01E+08 ######## 896 651.21 524.96 583484.2 470364.2 113120 Sub-Saharan Africa Slovakia Beverages Offline L ######## 1.75E+08 ######## 3973 47.45 31.79 188518.9 126301.7 62217.18 For this assignment you have been engaged by an...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT