package_mapping.sh 932 Bytes
Newer Older
wang-jinfeng committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
#!/bin/bash

# # # # # # # # # # # # # # # # # # # # # #
# @file    :package_mapping.sh
# @desc    :package_name ID化
# # # # # # # # # # # # # # # # # # # # # #

source ../dmp_env.sh

today=${ScheduleTime:-$1}
date=$(date +"%Y%m%d" -d "-1 day $today")

date_path=$(date +%Y/%m/%d -d "-1 day $today")

mount_path="s3://mob-emr-test/dataplatform/DataWareHouse/data/dwh/package_mapping/${date_path}"

spark-submit --class mobvista.dmp.datasource.retargeting.PackageMapping \
     --name "PackageMapping.${date}" \
     --conf spark.sql.shuffle.partitions=10 \
     --conf spark.default.parallelism=10 \
     --conf spark.driver.extraJavaOptions="-XX:+UseG1GC" \
     --master yarn --deploy-mode cluster --executor-memory 4g --driver-memory 4g  --executor-cores 1 --num-executors 1 \
     ../${JAR} \
     -output ${mount_path}

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

mount_partition "package_mapping" "dt='${date}'" "${mount_path}"