#!/bin/bash
source /etc/profile
updatetime=`date --date='0 days ago' +“%Y-%m-%d %H:%M:%S"`
echo "updatetime: "${updatetime}
hiveF /auto_cron/cron-running/bidw/dms/hq_bi/11.sql -updatetime ${updatetime}  //传updatetime参数

相应SQL文件

select '${updatetime}' from dms.tracklog_5min where day='20161002' limit 1;

报错:时分秒没有显示出来

解决办法:

使用

hive -f /home/dp/1.sql -d updatetime="${updatetime}" //原始的传参数

相应的Sql

select "${updatetime}" from dms.tracklog_5min where day='20161002' limit 1;

posted on 2017-04-05 19:56  流浪在伯纳乌  阅读(376)  评论(0)    收藏  举报