@@ -80,35 +80,8 @@ spark.sql("CREATE TEMPORARY FUNCTION arrayMerge AS 'com.gmei.hive.common.udf.UDF
sql_search_ctr=r"""
SELECT
cl_id,
card_id,
transaction_type,
count(distinct app_session_id) as session_pv
FROM
(
SELECT
cl_id,
card_id,
app_session_id,
transaction_type
from online.ml_community_precise_exposure_detail
WHERE partition_date>= '${today_str}'
AND action in ('page_precise_exposure','home_choiceness_card_exposure') --7745版本action改为page_precise_exposure
AND is_exposure = '1' ----精准曝光
AND page_name ='home'
AND tab_name = '精选'
AND (transaction_type in ('-1','smr','hotspot','pgc','newdata','hotspot_feed','aistragegy','excestragegy','FIXEDSTRATEGY','FIXEDSTRATEGY_VIDEO','high_quality_fmctr')
or transaction_type like '%ctr' or transaction_type like '%cvr' or transaction_type like 'deeplink%')
AND card_content_type in ('user_post')
AND transaction_type in ('high_quality_fmctr')
group by
cl_id,
transaction_type,
card_id,
app_session_id
) a group by cl_id,card_id,transaction_type
""".format(today_str='20200922')
select count(device_id) from online.ml_device_day_active_status where partition_date = '{today_str}' and active_type in (1,2)