曾经有一位HR让我学会了Hive再找ta , 于是我每天花12小时恶补hive知识7天后,我靠这9页知识点涨薪80%,分享如下:
一、DDL数据定义
1.加载数据
load data local inpath ‘路径’ into table 表名
2.重命名表
alter table 旧表名 rename 新表名
3.实操
(1)查询表结构
desc 表名
(2)添加列
alter table 表名 add 列名
(3)查询表结构
desc 表名
(4)更新列
alter table 表名 column 列名 desc int
(5)替换列
alter table 表名 replace columns(列名类型,列名类型)
4.删除表
drop table 表名
5.创建表
create table if not exists
6.清空表数据
truncate table 表名
二、DML 数据操作
1.加载数据
load data local inpath '路径' [overwrite