品牌單沒法展示排查

排查過程:sql

1,查看單子是否在內存中; satool 登陸線上機器less

for campid in 164890874 164888366 164690854 163607808 162845617 162844063 ; do
echo $campid ;
grep $campid campaign_list.txt |wc -l
done
結果:都在內存生效

2,設備求交集,查看設備重合度oop

2.1 獲取設備google

下載設備到本地文件unix

for campid in 164890874 164888366 164690854 163607808 162845617 162844063 ; do
echo $campid ;
query_campaign $campid > "$campid"
devid=`cat "$campid" |grep deviceId |awk -F"\"" '{print $4}' `
wget $devid
done

 

3,將設備上傳到s3 進行計算 code

aws s3 cp file   s3://mob-emr-test/shenlei.zhong/tmp_job/imp/info內存

4,hive 查詢:hadoop

sql="use adn_dsp ; select dev.devid ,req.googleadid from dsp_dev.devid as dev left join
(select googleadid from
log_adn_dsp_request_hour where concat ( yr,mt,dt)= '20170807' and countrycode = 'KR' group by googleadid ) as req on( dev.devid = req.googleadid ) ;"
hive -e "$sql" > count.out文檔

5, 導出韓國某天全部設備get

34.226.89.5機器

sql="use adn_dsp ; select dev.devid ,req.googleadid from dsp_dev.devid as dev left join
(select googleadid from
log_adn_dsp_request_hour where concat ( yr,mt,dt)= '20170807' and countrycode = 'KR' group by googleadid ) as req on( dev.devid = req.googleadid ) ;"

sql="use adn_dsp ; INSERT OVERWRITE DIRECTORY 's3://emr-test/ha/cpcm-dev/kr-devids.txt'
select googleadid from
log_adn_dsp_request_hour where concat ( yr,mt,dt)= '20170807' and countrycode = 'KR' group by googleadid ;"

hive -e "$sql" >kr-req-devids.txt

6,韓國設備導出到本地

hadoop fs -getmerge  s3://emr-test/hao/cpcm-dev/kr-devids.txt/    devid.txt

7, 設備計算交集

cat xxx.txt |sort -u > 1

cat  1  krdev.txt   |sort |uniq -c |awk -F"  " '$1 >1 '

獲取交集

cat  1  krdev.txt   |sort |uniq -c |awk -F"  " '$1 >1 ' |wc -l

8,能夠先去devIdList.txt查看生成的設備列表

/data/model_update/model_from_rsync

grep    162844063   devIdList.txt  |less 

9,設備列表格式轉換

notepad++ 編輯 裏面 文檔格式轉換  選擇unix格式

從新上傳設備列表

 

10, s3詞表同步

aws s3 cp      s3://mob-dict/beijing/dsp/  .    --recursive   &

相關文章
相關標籤/搜索