#!/usr/bin/env bash
# 从dm_install_list_v2表在reyun分区里的com.eg.android.AlipayGphone设备拉出来到某个路径里（天级别更新）, 后续需要把这个人群包入rtdmp，命名为com.eg.android.AlipayGphone_reyun

source ../../dmp_env.sh

dt_today=$(date -d "$ScheduleTime 1 days ago" +"%Y%m%d")
dt_dash_today=$(date -d "$ScheduleTime 1 days ago" +"%Y/%m/%d")

business="reyun"
INPUT_PATH="${DM_INSTALL_LIST}_v2/${dt_dash_today}/${business}"
check_await ${INPUT_PATH}/_SUCCESS

OUTPUT_PATH="${RTDMP_COM_EG_ANDROID_ALIPAYGPHONE_REYUN_PATH}/${dt_dash_today}/"
hadoop fs -rm -r "${OUTPUT_PATH}"

spark-submit --class mobvista.dmp.datasource.dm.ComEgAndroidAlipayGphoneReyun \
 --conf spark.yarn.executor.memoryOverhead=2048  \
 --conf spark.default.parallelism=3000 \
 --conf spark.sql.shuffle.partitions=3000 \
 --conf spark.driver.maxResultSize=4g \
 --conf spark.network.timeout=720s \
 --files ${HIVE_SITE_PATH} \
 --master yarn --deploy-mode cluster  --executor-memory 8g --driver-memory 6g  --executor-cores 6  --num-executors 20 \
 ../../${JAR} -dt_today ${dt_today}    -output ${OUTPUT_PATH}   -coalesce 200


if [[ $? -ne 0 ]]; then
    exit 255
fi
