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

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

相关文章:

  • 2021-11-20
  • 2021-11-20
  • 2021-11-20
  • 2021-11-21
  • 2022-01-08
  • 2021-05-26
  • 2021-08-01
猜你喜欢
  • 2022-01-10
  • 2021-06-30
  • 2021-08-23
  • 2021-07-28
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
相关资源
相似解决方案