parse_to_hive.sh 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/bash
  2. year=""
  3. version=""
  4. if(($#==2))
  5. then
  6. year=$1
  7. version=$2
  8. else
  9. exit -1
  10. fi
  11. set -x
  12. export SPARK_HOME=/opt/apps/SPARK2/spark-2.4.8-hadoop3.2-1.0.8
  13. export PATH=$SPARK_HOME/bin:$PATH
  14. export HADOOP_CONF_DIR=/etc/taihao-apps/hadoop-conf
  15. export JAVA_HOME=/usr/lib/jvm/java-1.8.0
  16. # params
  17. input_path=/dw/recommend/model/user_profile/gender/result/
  18. suffix="y,8,4,0,e,a,c,k,o,w,g,s,u,q,i,m"
  19. #suffix="y"
  20. project=loghubods
  21. output_table=alg_recsys_user_behavior_gender_tmp
  22. # to hive
  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_recsys_r_rate.parse_gender_to_hive \
  25. --master yarn --driver-memory 4G --executor-memory 6G --executor-cores 1 --num-executors 8 \
  26. --conf spark.yarn.executor.memoryoverhead=2048 \
  27. /mnt/disk1/jch/recommend-emr-dataprocess/target/spark-examples-1.0.0-SNAPSHOT-jar-with-dependencies.jar \
  28. inputPath:${input_path} \
  29. year:${year} \
  30. suffix:${suffix} \
  31. project:${project} \
  32. outputTable:${output_table} \
  33. version:${version} \