Question

10-25. Write two HIVE queries, the first to create a PRODUCT table with fields ProdID, Name, Seller, Price; the sec- ond to l
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. To Create Table:-

create table if not exists PRODUCT (ProdID int, Name string, Seller string, Price float)  row format delimited  fields terminated by ',' ;  

Output:

INFO : Executing command (queryId=hive_20200129020612_e6cc96a-1243-4843-9689-ace442b99f78): create table if not exists PRODUC

2. Assuming that the file that is to be loaded int the table is product.csv and it is present in the downloads folder of my computer it's location will be "/Users/my_name/Downloads/product.csv". So the query to load data will be:-

LOAD DATA INPATH '/Users/my_name/Downloads/product.csv' INTO TABLE PRODUCT;

Note:- file product.csv will get automatically deleted after loading data into the PRODUCT table.

Add a comment
Know the answer?
Add Answer to:
10-25. Write two HIVE queries, the first to create a PRODUCT table with fields ProdID, Name,...
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
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
ADVERTISEMENT