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)]
二、运行jar文件
#!/bin/sh rm -f ./gdesc_delivery_analysis-1.0.0.jar hdfs dfs -get /user/upload/gdesc_delivery_analysis-1.0.0.jar spark-submit --queue iras --master yarn --driver-memory 2g --num-executors 5 --executor-memory 2g --executor-cores 2 \ --class com.sf.ibu.goods.main.Main gdesc_delivery_analysis-1.0.0.jar
浙公网安备 33010602011771号