#!/bin/bash
#登录权限
source /opt/hadoopclient/bigdata_env
#输入账号密码
/usr/bin/expect <<-EOF
set time 5
spawn kinit tian
expect {
"Password" {send "Huawei#123\r"}
}
expect eof
EOF
#read -p "请输入开始时间:" startDay
#read -p "请输入结束时间:" endDay
#read -p "请输入hql文件名:" hql
startDay=$1
endDay=$2
hql=$3
if [ ! -n "$1" ];then
echo "按当前时间进行计算"
startDay=`date +%Y-%m-%d`
endDay=`date +%Y-%m-%d -d "-1day"`
read -p "请输入hql文件名:" hql
fi
beeline --hivevar startDay="${startDay}" --hivevar endDay="${endDay}" -f ${hql}