Hive简介:https://blog.csdn.net/weixin_45102492/article/details/104418259
Hive安装部署 : https://blog.csdn.net/weixin_45102492/article/details/104418666
Hive数据类型: https://blog.csdn.net/weixin_45102492/article/details/91048019
Hive之DDL数据定义: https://blog.csdn.net/weixin_45102492/article/details/91349323
Hive之查询 :https://blog.csdn.net/weixin_45102492/article/details/104410103
DML数据操作
数据导入
向表中装载数据(Load)
1.语法
hive> load data [local] inpath '/hyk/data/student.txt' overwrite | into table student [partition (partcol1=val1,…)];
(1)load data:表示加载数据
(2)local:表示从本地加载数据到hive表;否则从HDFS加载数据到hive表
(3)inpath:表示加载数据的路径
(4)overwrite:表示覆盖表中已有数据,否则表示追加
(5)into table:表示加载到哪张表
(6)student:表示具体的表
(7)partition:表示上传到指定分区
2.实操案例
(0)创建一张表
hive (db_hive)> create table student(id string, name string) row format delimited fields terminated by '\t';
(1)加载本地文件到hive
hive (db_hive)> load data local inpath '/hyk/data/student.txt' into table student;
(2)加载HDFS文件到hive中
上传文件到HDFS
hive (db_hive)> dfs -put /hyk/data