hue执行脚本报错(cdh6.3.1)
[root@cdh01 bin]# vim d_o.sh
#!/bin/bash
# 定义变量方便修改
AP=ll
# 如果是输入的日期按照取输入日期;如果没输入日期取当前时间的前一天
if [ -n "$1" ] ;then
d_date=$1
else
d_date=`date -d "-1 day" +%F`
fi
sql="
set hive.exec.dynamic.partition.mode=nonstrict;
insert overwrite table "$AP".d_o partition(dt)
select * from "$AP".o_fo
where dt='$d_date' and id is not null;
"
hive -e "$sql"
执行上面的脚本报错:
注:环境配置没问题,可以执行其他脚本
将 d_o.sh的 第15行设置非严格模式删除(不动态分区,手动分区)(set hive.exec.dynamic.partition.mode=nonstrict;)修改为:
[root@cdh01 bin]# vim d_o.sh
#!/bin/bash
# 定义变量方便修改
AP=ll
# 如果是输入的日期按照取输入日期;如果没输入日期取当前时间的前一天
if [ -n "$1" ] ;then
d_date=$1
else
d_date=`date -d "-1 day" +%F`
fi
sql="
insert overwrite table "$AP".d_o partition(dt='$d_date')
select
id ,
total_amount ,
order_status ,
user_id ,
payment_way ,
out_trade_no ,
create_time ,
operate_time
from "$AP".o_fo
where dt='$d_date' and id is not null
;
"
hive -e "$sql"
执行成功没