Commit 49ffa0fc authored by litaolemo's avatar litaolemo

update

parent 20e760f6
......@@ -80,8 +80,33 @@ spark.sql("CREATE TEMPORARY FUNCTION arrayMerge AS 'com.gmei.hive.common.udf.UDF
sql_search_ctr = r"""
select * from online.bl_hdfs_maidian_updates where partition_date = '20200915' and cl_id is not null
"""
SELECT
cl_id,
card_id,
count(distinct app_session_id) as session_pv
from
(
SELECT
cl_id,
card_id,
app_session_id
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')
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 order by app_session_id desc
""".format(today_str='20200922')
print(sql_search_ctr)
search_ctr_df = spark.sql(sql_search_ctr)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment