将CSV格式或者EXCEL格式的文件导入到HIVE数据仓库中

学习内容:数据导入,要求将CSV格式或者EXCEL格式的文件导入到HIVE数据仓库中;

①hive建表:test1

create table test1

(InvoiceNo String, StockCode String, Description String, Quantity String, InvoiceDate String, UnitPrice String, CustomerID String, Country String)

ROW format delimited fields terminated by ',' STORED AS TEXTFILE;

②将/opt/module/data/路径下的文件test.csv导入表test1:

load data local inpath '/opt/module/data/test.csv' into table test1;

③查询表test1中所有数据;

select * from test1;

 

 

 

posted @ 2021-09-29 08:12  CherriesOvO  阅读(413)  评论(0编辑  收藏  举报