Hive_hdfs csv导入hive demo

1 create csv file.
student.csvspa

4,Rose,M,78,77,76
5,Mike,F,99,98,98

2 put it to hdfs.code

# hdfs dfs -put student.csv /input

3 create table in hive.orm

create table student_csv
(sid int, sname string, gender string, language int, math int, english int)
row format delimited fields terminated by ',' stored as textfile;

4 load hdfs file to hive.blog

load data inpath '/input/student.csv' into table student_csv;

5 verify.input

hive> select * from student_csv;
OK
4 Rose M 78 77 76
5 Mike F 99 98 98