${end_date}));thenecho "beg_date < end_date"exit 0;ficurrentDate=""for((i=${beg_date};i<=${end_date};i=i+86400))docurrentDate=`date -d @${i} +%Y%m%d..._hive执行创表语句脚本">
赞
踩
#!/bin/bash
beg_date=`date -d "${1}" +%s`
end_date=`date -d "${2}" +%s`
if((beg_date >${end_date}));then
echo "beg_date < end_date"
exit 0;
fi
currentDate=""
for((i=${beg_date};i<=${end_date};i=i+86400))
do
currentDate=`date -d @${i} +%Y%m%d`
echo "-----create /${currentDate}-----"
hive -e "use data;create table order_status_log${currentDate}(id string,order_id string,order_status string,operate_time string) row format delimited fields terminated by ',';"
done
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。