#! /bin/env bash
date_type=$2
date_info=$3

if [ $1 == all ];
then
    site_name_array=(us uk de es fr it)
else
    site_name_array=($1)
fi

for site_name in ${site_name_array[*]}
	do
		echo 监听日搜索词是否抓取完成
		/opt/module/anaconda3/envs/pyspark/bin/python /opt/module/spark/demo/py_demo/listen_program/listen_workflow.py $site_name $date_type $date_info 4
		echo 导入关键词数据
		/mnt/run_shell/sqoop_shell/import/ods_brand_analytics.sh $site_name $date_type $date_info
		/mnt/run_shell/sqoop_shell/import/ods_search_term_type.sh $site_name all $date_type $date_info
		echo 计算关键词对应的asin数据
		/mnt/run_shell/spark_shell/dim/spark_dim_st_asin_info.sh $site_name $date_type $date_info
		/mnt/run_shell/spark_shell/dwd/spark_dwd_asin_to_pg.sh $site_name $date_type $date_info
		echo 导出去重的asin数据到pg
		/mnt/run_shell/sqoop_shell/export/dwd_asin_to_pg.sh $site_name $date_type $date_info
		/opt/module/anaconda3/envs/pyspark/bin/python /opt/module/spark/demo/py_demo/listen_program/listen_workflow.py $site_name $date_type $date_info 8
	done
