hive 数据加载

20190905


1、从本地导入hive

load data [local] inpath 'filepath' [overwrite] into table table_name [partition(part1=val1)]

2、从HDFS中导入数据

--1.将文件上传到:HDFS的data目录下面
hadoop fs -put load_data_hdfs.txt /data
--2.在Hive中执行命令
load data inpath 'data/load_data_hdfs.txt' into table load_data_hdfs;

3、从其他的Hive表中导入数据

insert into table load_data_local2 select * from load_data_local;

4、创建表的同时导入数据

create table load_data_local3 as select * from load_data_local;

参考

博客园-参考1
CSDN-参考2

01-23 11:53