25_xgb_make_data_origin_bucket.sh 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #!/bin/sh
  2. set -x
  3. export PATH=$SPARK_HOME/bin:$PATH
  4. export HADOOP_CONF_DIR=/etc/taihao-apps/hadoop-conf
  5. export JAVA_HOME=/usr/lib/jvm/java-1.8.0
  6. export SPARK_HOME=/opt/apps/SPARK2/spark-2.4.8-hadoop3.2-1.0.8
  7. sh_path=$(dirname $0)
  8. source ${sh_path}/00_common.sh
  9. source /root/anaconda3/bin/activate py37
  10. make_origin_data() {
  11. local step_start_time=$(date +%s)
  12. /opt/apps/SPARK2/spark-2.4.8-hadoop3.2-1.0.8/bin/spark-class2 org.apache.spark.deploy.SparkSubmit \
  13. --class com.aliyun.odps.spark.examples.makedata_ad.v20240718.makedata_ad_31_originData_20240718 \
  14. --master yarn --driver-memory 1G --executor-memory 2G --executor-cores 1 --num-executors 16 \
  15. ./target/spark-examples-1.0.0-SNAPSHOT-shaded.jar \
  16. tablePart:64 repartition:32 \
  17. beginStr:${today_early_1}00 endStr:${today_early_1}12 \
  18. savePath:${TRAIN_PATH} \
  19. table:${TABLE} \
  20. filterHours:00,01,02,03,04,05,06,07 \
  21. idDefaultValue:0.1 &
  22. local task1=$!
  23. /opt/apps/SPARK2/spark-2.4.8-hadoop3.2-1.0.8/bin/spark-class2 org.apache.spark.deploy.SparkSubmit \
  24. --class com.aliyun.odps.spark.examples.makedata_ad.v20240718.makedata_ad_31_originData_20240718 \
  25. --master yarn --driver-memory 1G --executor-memory 2G --executor-cores 1 --num-executors 16 \
  26. ./target/spark-examples-1.0.0-SNAPSHOT-shaded.jar \
  27. tablePart:64 repartition:32 \
  28. beginStr:${today_early_1}13 endStr:${today_early_1}18 \
  29. savePath:${TRAIN_PATH} \
  30. table:${TABLE} \
  31. filterHours:00,01,02,03,04,05,06,07 \
  32. idDefaultValue:0.1 &
  33. local task2=$!
  34. /opt/apps/SPARK2/spark-2.4.8-hadoop3.2-1.0.8/bin/spark-class2 org.apache.spark.deploy.SparkSubmit \
  35. --class com.aliyun.odps.spark.examples.makedata_ad.v20240718.makedata_ad_31_originData_20240718 \
  36. --master yarn --driver-memory 1G --executor-memory 2G --executor-cores 1 --num-executors 16 \
  37. ./target/spark-examples-1.0.0-SNAPSHOT-shaded.jar \
  38. tablePart:64 repartition:32 \
  39. beginStr:${today_early_1}19 endStr:${today_early_1}23 \
  40. savePath:${TRAIN_PATH} \
  41. table:${TABLE} \
  42. filterHours:00,01,02,03,04,05,06,07 \
  43. idDefaultValue:0.1 &
  44. local task3=$!
  45. wait ${task1}
  46. local task1_return_code=$?
  47. wait ${task2}
  48. local task2_return_code=$?
  49. wait ${task3}
  50. local task3_return_code=$?
  51. check_run_status ${task1_return_code} ${step_start_time} "spark原始样本生产任务: 生产00~12数据异常"
  52. check_run_status ${task2_return_code} ${step_start_time} "spark原始样本生产任务: 生产13~18数据异常"
  53. check_run_status ${task3_return_code} ${step_start_time} "spark原始样本生产任务: 生产19~23数据异常"
  54. }
  55. make_bucket_feature() {
  56. local step_start_time=$(date +%s)
  57. /opt/apps/SPARK2/spark-2.4.8-hadoop3.2-1.0.8/bin/spark-class2 org.apache.spark.deploy.SparkSubmit \
  58. --class com.aliyun.odps.spark.examples.makedata_ad.v20240718.makedata_ad_33_bucketData_20240718 \
  59. --master yarn --driver-memory 2G --executor-memory 4G --executor-cores 1 --num-executors 16 \
  60. ./target/spark-examples-1.0.0-SNAPSHOT-shaded.jar \
  61. beginStr:${today_early_1} endStr:${today_early_1} repartition:100 \
  62. filterNames:_4h_,_5h_,adid_,targeting_conversion_ \
  63. readPath:${TRAIN_PATH} \
  64. savePath:${BUCKET_FEATURE_PATH}
  65. local return_code=$?
  66. check_run_status ${return_code} ${step_start_time} "spark特征分桶任务"
  67. }