-----SQL------ alter table tranods.name drop if exists partition (dt='20220110') ,partition (dt='20220111') ,partition (dt='20220109') ----结果展示----- Logging initialized using configuration in file:/etc/hive/conf.dist/hive-log4j2.properties Async: false hive> alter table tranods.name drop if exists partition (dt='20220110'),partition (dt='20220111'),partition (dt='20220109'); Dropped the partition dt=20220111 Dropped the partition dt=20220110 Dropped the partition dt=20220109 OK Time taken: 2.129 seconds
温馨提示:如果一次性拼接过多的分区,hive会执行报错,所以可以分批次执行
2 hive添加分区指定多个子路径alter table tranods.name add partition (dt='20210728')
location 's3://.your path.../log_data/20210728/{16,17,18,19,20,21,22,23}/*';



