hive load 把文件导入到hive表中 - ① 准备txt文件
实操
1、导入本地数据文件
① 准备txt文件
② 导入到服务器中
③ 创建数据表
create table student(
id int,
name string
)
row format delimited fields terminated by '\t';
④ 导入数据
load data local inpath '/opt/module/datas/student.txt' into table student;
⑤ 查看数据
2、导入hdfs上的数据文件
① 上传到hdfs 拼多多帮助力入口
[atguigu@hadoop102 ~]$ hadoop fs -put /opt/module/datas/student.txt /user/atguigu
② 导入数据
load data inpath '/user/atguigu' into table student;
load之后,数据就被移动走了
好文推荐,hive