Hive 基本操作-Partition(分区)

1)添加分区
alter table bst_bas_hailing_order add if not exists partition(dt_year='${v_dt_year}');
2)删除分区
alter table bst_bas_hailing_order drop if exists partition(dt_year='${v_dt_year}');
3)  查看分区
show partitions bst_bas_hailing_order;
4)修复分区
msck repair table bst_bas_hailing_order;
一般用在外部表,新建的表需要添加对应分区的时候,直接使用修复分区。

posted @ 2020-09-07 11:39  楔子  阅读(1108)  评论(0)    收藏  举报