Hive与Sql语言很像,

 

use 数据库;

以建一个student表为例:

create table student(id int,name string) row format delimited fields terminated by "\t";

Hive建表与导入文件中的数据

 

 编写student.txt文件(中间以tab键隔开  即 \t )

2   Tiny
3   Fun
4    Mark
5    Yong

load data local inpath "/opt/module/datas/student.txt" into table student;

Hive建表与导入文件中的数据

 

 

Hive建表与导入文件中的数据

 

 OK

相关文章: