Hive_hdfs導入csv文件


轉自:Hive_hdfs csv導入hive demo

 

1 create csv file.
student.csv

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

2 put it to hdfs.

# hdfs dfs -put student.csv /input

3 create table in hive.

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.

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

5 verify.

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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM