1 创建一个分区表
create table t_partition001(ip string,duration int) partitioned by(country string) row format delimited fields terminated by ',';
2 添加数据
load data local inpath '/root/hivedata/t_partitioned' into table t_partition001 partition(country="China");
3 增加一个分区
alter table t_partition001 add partition(country="Japan");
4添加数据
load data local inpath '/root/hivedata/t_partitioned' into table t_partition001 partition(country="Japan");
5 show partitions t_partition001;
6删除分区
alter table t_partition001 drop partition(country="Japan");
7修改表名
alter table t_partition001 rename to t_partition002;
8表增加一列
alter table t_partition002 add columns(city string);
9 替换表中所有字段
alter table t_partition002 replace columns(name string);
10 更新某一列