上传csv或txt文件到hive中

1、将文件上传到Linux本地

2、启动hive服务,在hive下建表
create table lingshou_csv (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;


3、上传文件到hdfs
load data local inpath '/kkb/install/hive/lingshou.csv' into table lingshou_csv;

4、上传成功

5、查看表中前10条数据

select * from 表名 limit 10

posted on 2021-09-29 20:11  桑榆非晚柠月如风  阅读(325)  评论(0编辑  收藏  举报