// | ( case when imei not in ('0','00000000-0000-0000-0000-000000000000','',' ','00000000','00000000000000','000000000000000','0000000000000000') then imei else null end) as imei,
// | ( case when ext_oaid not in ('00000000-0000-0000-0000-000000000000','0000000000000000','0','',' ') then ext_oaid else null end ) as oaid,
// | md5(case when imei not in ('0','00000000-0000-0000-0000-000000000000','','00000000','00000000000000','000000000000000','0000000000000000') then imei else null end) as imeimd5,
// | md5(case when ext_oaid not in ('00000000-0000-0000-0000-000000000000','0000000000000000','0','',' ') then ext_oaid else null end ) as oaidmd5
// | FROM
// | dwh.ods_adn_trackingnew_request
// | where country_code = 'CN' and platform = 'android' and publisher_id in('11386','20284','16227','23652','18721','20781','22193','21522','21915') and app_id not in ('122317')
// | and concat(yyyy,'-',mm,'-',dd)=cast(date_sub(CURRENT_DATE, 1) as string)
// | ) tmpdata where imei is not null and oaid is not null and imeimd5 is not null and oaidmd5 is not null
// | ) t
// | ) tt
// | lateral view explode(split(data, ",")) num as onedata) ttt
// | union
// | select device_id,device_type
// | from
// | yesterday_data
// | where package_name='${package_name1}' ) tttt
// | group by device_id,device_type
// |""".stripMargin
valsql1=
s"""
...
...
@@ -171,47 +136,26 @@ class CnGoodChannel extends CommonSparkJob with Serializable {
| ( case when device_type in ('imei','oaid') then md5(device_id) else device_id end) as device_id,
| ( case when device_type in ('imei','oaid') then concat(device_type,"_md5") when device_type='imeimd5' then "imei_md5" when device_type='oaidmd5' then "oaid_md5" end) as device_type
// | ( case when imei not in ('0','00000000-0000-0000-0000-000000000000','',' ','00000000','00000000000000','000000000000000','0000000000000000') then imei else null end) as imei,
// | ( case when ext_oaid not in ('00000000-0000-0000-0000-000000000000','0000000000000000','0','',' ') then ext_oaid else null end ) as oaid,
// | md5(case when imei not in ('0','00000000-0000-0000-0000-000000000000','','00000000','00000000000000','000000000000000','0000000000000000') then imei else null end) as imeimd5,
// | md5(case when ext_oaid not in ('00000000-0000-0000-0000-000000000000','0000000000000000','0','',' ') then ext_oaid else null end ) as oaidmd5
// | FROM
// | dwh.ods_adn_trackingnew_request
// | where country_code = 'CN' and platform = 'android' and publisher_id in('18590','21933','13566','19672','26101','21386')
// | and concat(yyyy,'-',mm,'-',dd)=cast(date_sub(CURRENT_DATE, 1) as string)
// | ) tmpdata where imei is not null and oaid is not null and imeimd5 is not null and oaidmd5 is not null
// | ) t
// | ) tt
// | lateral view explode(split(data, ",")) num as onedata) ttt
// | union
// | select device_id,device_type
// | from
// | yesterday_data
// | where package_name='${package_name2}' ) tttt
// | group by device_id,device_type
// |""".stripMargin
valsql2=
s"""
...
...
@@ -252,8 +196,21 @@ class CnGoodChannel extends CommonSparkJob with Serializable {
| ( case when device_type in ('imei','oaid') then md5(device_id) else device_id end) as device_id,
| ( case when device_type in ('imei','oaid') then concat(device_type,"_md5") when device_type='imeimd5' then "imei_md5" when device_type='oaidmd5' then "oaid_md5" end) as device_type
| ( case when device_type in ('imei','oaid') then md5(device_id) else device_id end) as device_id,
| ( case when device_type in ('imei','oaid') then concat(device_type,"_md5") when device_type='imeimd5' then "imei_md5" when device_type='oaidmd5' then "oaid_md5" end) as device_type