#!/bin/bash
today_date=`date -d "-3 day" +%Y%m%d`
#变量中存储的是3天前的日期
tables=(cat $1)
for table in ${tables[@]}
do
echo $table
hive -e "alter table 数据库名.$table drop if exists partition(d<'$today_date')"
done
shell脚本批量删除多张Hive表的历史分区
最新推荐文章于 2023-03-20 14:32:58 发布