hadoop hdfs csv导入hive表

create table toys.test
(id int, x0 double, x1 double, x2 double, x3 double)
row format delimited fields terminated by ',' stored as textfile;

 先在hive 数据库toys创建表test,注意行分割符号为,逗号

 

上传本地数据到hdfs

hadoop fs -put  /data/projects/breast.csv    /data/projects/breast.csv

hdfs上传到hive

LOAD DATA INPATH  '/data/projects/breast.csv'   overwrite into table  toys.test ; 

 

posted @ 2020-05-28 15:51  不带R的墨菲特  阅读(862)  评论(0编辑  收藏  举报