| FROM dwh.ods_adn_trackingnew_request_tmp_hb_request WHERE CONCAT(yyyy,mm,dd,hh) = '$datetime' AND re = '${region}_hb_request'
| FROM dwh.ods_adn_trackingnew_request_tmp_hb_request WHERE yyyy = '$year' and mm = '$month' and dd = '$day' and hh = '$hh' AND re = '${region}_hb_request'
|join Campaignid_Packagename t3 on t2.campaignid=t3.id
|union
|select t1.device_id,t1.device_type,t1.platform,t1.data,t1.model,t1.country,t1.sdk_version,t1.brand,t2.campaign_id,t2.package_name from (select * from adn_sdk_input_2000047 where hb='1') t1
|join (select get_json_object(ext_dsp, '$$.bd') package_name,bidid rid_n,get_json_object(ext_dsp, '$$.cid') campaign_id from dwh.ods_adn_hb_v1_bid where concat(yyyy,mm,dd)='${loadTime}') t2 on t1.rid_n=t2.rid_n
|join (select get_json_object(ext_dsp, '$$.bd') package_name,bidid rid_n,get_json_object(ext_dsp, '$$.cid') campaign_id from dwh.ods_adn_hb_v1_bid
| where yyyy = '$year' and mm = '$month' and dd = '$day') t2 on t1.rid_n=t2.rid_n
// case when name='11' then 'android' when name='aa' then 'ios' end as os_platform,
try{
valyear=dt_today.substring(0,4)
valmonth=dt_today.substring(4,6)
valday=dt_today.substring(6,8)
// 当日新增设备
valappend_sql=
s"""
...
...
@@ -68,42 +71,42 @@ class BtopDaily extends CommonSparkJob with Serializable {
| os_platform,
| qcc_package,
| country_code
| from uparpu_main.uparpu_plugin_qcc_package where concat(yyyy,mm,dd)='${dt_today}' and imei!='' and qcc_package_install_status='1'
| from uparpu_main.uparpu_plugin_qcc_package where yyyy = '$year' and mm = '$month' and dd = '$day' and imei!='' and qcc_package_install_status='1'
| union
| select gaid device_id,
| 'gaid' device_type,
| os_platform,
| qcc_package,
| country_code
| from uparpu_main.uparpu_plugin_qcc_package where concat(yyyy,mm,dd)='${dt_today}' and gaid!='' and qcc_package_install_status='1'
| from uparpu_main.uparpu_plugin_qcc_package where yyyy = '$year' and mm = '$month' and dd = '$day' and gaid!='' and qcc_package_install_status='1'
| union
| select idfa device_id,
| 'idfa' device_type,
| os_platform,
| qcc_package,
| country_code
| from uparpu_main.uparpu_plugin_qcc_package where concat(yyyy,mm,dd)='${dt_today}' and idfa!='' and qcc_package_install_status='1'
| from uparpu_main.uparpu_plugin_qcc_package where yyyy = '$year' and mm = '$month' and dd = '$day' and idfa!='' and qcc_package_install_status='1'
| union
| select android_id device_id,
| 'android_id' device_type,
| os_platform,
| qcc_package,
| country_code
| from uparpu_main.uparpu_plugin_qcc_package where concat(yyyy,mm,dd)='${dt_today}' and android_id!='' and qcc_package_install_status='1'
| from uparpu_main.uparpu_plugin_qcc_package where yyyy = '$year' and mm = '$month' and dd = '$day' and android_id!='' and qcc_package_install_status='1'
| union
| select idfv device_id,
| 'idfv' device_type,
| os_platform,
| qcc_package,
| country_code
| from uparpu_main.uparpu_plugin_qcc_package where concat(yyyy,mm,dd)='${dt_today}' and idfv!='' and qcc_package_install_status='1'
| from uparpu_main.uparpu_plugin_qcc_package where yyyy = '$year' and mm = '$month' and dd = '$day' and idfv!='' and qcc_package_install_status='1'
| union
| select oaid device_id,
| 'oaid' device_type,
| os_platform,
| qcc_package,
| country_code
| from uparpu_main.uparpu_plugin_qcc_package where concat(yyyy,mm,dd)='${dt_today}' and oaid!='' and qcc_package_install_status='1'
| from uparpu_main.uparpu_plugin_qcc_package where yyyy = '$year' and mm = '$month' and dd = '$day' and oaid!='' and qcc_package_install_status='1'
| ) t1
|join
|(select id,package_name from uparpu_main.uparpu_qcc_package ) t2
...
...
@@ -127,42 +130,42 @@ class BtopDaily extends CommonSparkJob with Serializable {
| os_platform,
| qcc_package,
| country_code
| from uparpu_main.uparpu_plugin_qcc_package where concat(yyyy,mm,dd)='${dt_today}' and imei!='' and qcc_package_install_status='2'
| from uparpu_main.uparpu_plugin_qcc_package where yyyy = '$year' and mm = '$month' and dd = '$day' and imei!='' and qcc_package_install_status='2'
| union
| select gaid device_id,
| 'gaid' device_type,
| os_platform,
| qcc_package,
| country_code
| from uparpu_main.uparpu_plugin_qcc_package where concat(yyyy,mm,dd)='${dt_today}' and gaid!='' and qcc_package_install_status='2'
| from uparpu_main.uparpu_plugin_qcc_package where yyyy = '$year' and mm = '$month' and dd = '$day' and gaid!='' and qcc_package_install_status='2'
| union
| select idfa device_id,
| 'idfa' device_type,
| os_platform,
| qcc_package,
| country_code
| from uparpu_main.uparpu_plugin_qcc_package where concat(yyyy,mm,dd)='${dt_today}' and idfa!='' and qcc_package_install_status='2'
| from uparpu_main.uparpu_plugin_qcc_package where yyyy = '$year' and mm = '$month' and dd = '$day' and idfa!='' and qcc_package_install_status='2'
| union
| select android_id device_id,
| 'android_id' device_type,
| os_platform,
| qcc_package,
| country_code
| from uparpu_main.uparpu_plugin_qcc_package where concat(yyyy,mm,dd)='${dt_today}' and android_id!='' and qcc_package_install_status='2'
| from uparpu_main.uparpu_plugin_qcc_package where yyyy = '$year' and mm = '$month' and dd = '$day' and android_id!='' and qcc_package_install_status='2'
| union
| select idfv device_id,
| 'idfv' device_type,
| os_platform,
| qcc_package,
| country_code
| from uparpu_main.uparpu_plugin_qcc_package where concat(yyyy,mm,dd)='${dt_today}' and idfv!='' and qcc_package_install_status='2'
| from uparpu_main.uparpu_plugin_qcc_package where yyyy = '$year' and mm = '$month' and dd = '$day' and idfv!='' and qcc_package_install_status='2'
| union
| select oaid device_id,
| 'oaid' device_type,
| os_platform,
| qcc_package,
| country_code
| from uparpu_main.uparpu_plugin_qcc_package where concat(yyyy,mm,dd)='${dt_today}' and oaid!='' and qcc_package_install_status='2'
| from uparpu_main.uparpu_plugin_qcc_package where yyyy = '$year' and mm = '$month' and dd = '$day' and oaid!='' and qcc_package_install_status='2'
| ) t1
|join
|(select id,package_name from uparpu_main.uparpu_qcc_package ) t2
|SELECT b.device_id, device_model, os_version, UPPER(country) country, city, CAST(b.offer_id AS string) offer_id, CAST(COALESCE(a.id,'') AS string) id, COALESCE(a.event_name,'') event_name, a.event_type FROM
| (SELECT devid device_id, MAX(device) device_model, MAX(os_version) os_version, MAX(country) country, MAX(city) city, uuid offer_id FROM dwh.ods_3s_trackingnew_install WHERE CONCAT(yyyy,mm,dd) = '@date' GROUP BY devid, uuid) b
| (SELECT devid device_id, MAX(device) device_model, MAX(os_version) os_version, MAX(country) country, MAX(city) city, uuid offer_id FROM dwh.ods_3s_trackingnew_install
| WHERE yyyy = '@year' and mm = '@month' and dd = '@day' GROUP BY devid, uuid) b
| LEFT JOIN
| (SELECT id, event_name, event_type, offer_id FROM dwh.ods_3s_trackingcsv_event_define WHERE yyyymmdd = '@date') a
| ON a.offer_id = b.offer_id
...
...
@@ -57,7 +58,8 @@ object Constant {
valtracking_event_sql:String=
"""
|SELECT b.device_id, UPPER(country) country, CAST(b.offer_id AS string) offer_id, COALESCE(a.id, b.event_name) id, COALESCE(a.event_name, b.event_name) event_name, COALESCE(a.event_type,'') event_type FROM
| (SELECT devid device_id, MAX(country) country, event_name, uuid offer_id FROM dwh.ods_3s_trackingcsv_event_info WHERE yyyymmdd = '@date' AND devid IS NOT NULL AND devid <> '' GROUP BY devid, event_name, uuid) b
@@ -53,6 +53,10 @@ class PostBackEvent extends CommonSparkJob with java.io.Serializable {
try{
valyear=today.substring(0,4)
valmonth=today.substring(4,6)
valday=today.substring(6,8)
valsql1=
s"""
|select UPPER(idfa) idfa,
...
...
@@ -69,7 +73,7 @@ class PostBackEvent extends CommonSparkJob with java.io.Serializable {
|install_time,
|cast(`date` as string) update_date,
|type
|from dwh.ods_adn_trackingnew_postback_event where concat(yyyy,mm,dd) = '${today}' and type in ('appsflyer','min_appsflyer','tenjin','adjust')
|from dwh.ods_adn_trackingnew_postback_event where yyyy = '$year' and mm = '$month' and dd = '$day' and type in ('appsflyer','min_appsflyer','tenjin','adjust')
|select UPPER(idfa) idfa,md5_idfa,LOWER(gaid) gaid,md5_gaid,lower(pl) platform,lower(app_id) package_name,country,install_time,cast(`date` as string) update_date,type from dwh.ods_adn_trackingnew_postback_install where concat(yyyy,mm,dd) = '${today}' and type in ('appsflyer','min_appsflyer','tenjin','adjust','reyun') and app_id!="0"
|select UPPER(idfa) idfa,md5_idfa,LOWER(gaid) gaid,md5_gaid,lower(pl) platform,lower(app_id) package_name,country,install_time,cast(`date` as string) update_date,type from dwh.ods_adn_trackingnew_postback_install
| where yyyy = '$year' and mm = '$month' and dd = '$day' and type in ('appsflyer','min_appsflyer','tenjin','adjust','reyun') and app_id!="0"
|union
|select UPPER(idfa) idfa,md5_idfa,LOWER(gaid) gaid,md5_gaid,lower(pl) platform,lower(app_id) package_name,country,install_time,cast(`date` as string) update_date,type from dwh.ods_adn_trackingnew_postback_event where concat(yyyy,mm,dd) = '${today}' and type in ('appsflyer','min_appsflyer','tenjin','adjust','reyun') and app_id!="0"
|select UPPER(idfa) idfa,md5_idfa,LOWER(gaid) gaid,md5_gaid,lower(pl) platform,lower(app_id) package_name,country,install_time,cast(`date` as string) update_date,type from dwh.ods_adn_trackingnew_postback_event
| where yyyy = '$year' and mm = '$month' and dd = '$day' and type in ('appsflyer','min_appsflyer','tenjin','adjust','reyun') and app_id!="0"