How to Update/Drop a Hive Partition?

前端 未结 5 652
迷失自我
迷失自我 2020-12-12 10:55

After adding a partition to an external table in Hive, how can I update/drop it?

5条回答
  •  無奈伤痛
    2020-12-12 11:51

    in addition, you can drop multiple partitions from one statement (Dropping multiple partitions in Impala/Hive).

    Extract from above link:

    hive> alter table t drop if exists partition (p=1),partition (p=2),partition(p=3);
    Dropped the partition p=1
    Dropped the partition p=2
    Dropped the partition p=3
    OK
    

    EDIT 1:

    Also, you can drop bulk using a condition sign (>,<,<>), for example:

    Alter table t 
    drop partition (PART_COL>1);
    

提交回复
热议问题