关于sql查询的一些事

2018-12-29  本文已影响0人  会飞的蜗牛66666

hiveSql.sh脚本
hive -e "insert into table test.sudian select split(a.key,'_')[0] as deviceid,(case when watchtime < 0 then 300000 when watchtime > 10800000 then 300000 else watchtime end) as watchtime from knowyou_edw.edw_userbehavior a where a.dt='$1' and a.code='0x0202' and a.videoname = '深夜书店'"

shudian.sh脚本 传入参数 20171001 20181227

!/bin/bash

begin_date=1 end_date=2
while [ "begin_date" != "end_date" ]
do
echo $begin_date

你的hive脚本

sh hiveSql.sh begin_date begin_date=`date -d "+1 days{begin_date}" +%Y%m%d`
don

上一篇 下一篇

猜你喜欢

热点阅读