hive平台Shell文件

2021/11/17 7:14:23

本文主要是介绍hive平台Shell文件,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

#!/bin/sh
#
for i in  '020W0700' '010WE0440' '020R0100' '020WE0300'

do
batch_code=$i
inc_day=$a
before=$b
sep_incday=$c
echo "tt   $sep_incday"
hive -e "
set mapreduce.job.queuename = root.ordi_predict;
set hive.exec.dynamic.partition.mode=nonstrict;
insert overwrite table dm_ordi_predict.batch_predict_result partition  (real_batch, inc_day)
select 
/*+mapjoin(a)*/
a.waybillno as waybillno_real,
a.dubbotime as real_dubbo,
a.opcode as real_op,
a.optime as real_optm,
get_json_object(compare_result,'$.showList[0].actualZone')actual_zone,
get_json_object(compare_result,'$.showList[2].staticBatch.batchCode') prd_batch,
get_json_object(compare_result,'$.wayBillBaseInfo.dubboParam') prd_input,
a.batchcode as real_batch,
$inc_day as inc_day
from 
(select
*
from
    dm_predict.dfs_wb_real_batchcode_log
where
    inc_day ='$inc_day'
    and batchcode = '$batch_code' ) a ;
"

done

参数配置:
序号 参数名称 参数值
1     a               $[time(yyyyMMdd)]
2     b               $[time(yyyyMMdd,-2d)]
3     c               $[time(yyyy-MM-dd)]



这篇关于hive平台Shell文件的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程