Commit 0fb4de8f authored by litaolemo's avatar litaolemo

update

parent 4c15a8f0
......@@ -84,25 +84,24 @@ for t in range(1, task_days):
sql_search_ctr = r"""
select D.ACTIVE_TYPE,D.DEVICE_OS_TYPE,sum(T.CLICK_NUM) as CLICK_NUM,sum(C.EXPOSURE) as EXPOSURE from
(SELECT PARAMS['card_id'] as CARD_ID,device_id as DEVICE_ID, COUNT(PARAMS['card_id']) AS EXPOSURE
(SELECT T.DEVICE_ID, --设备ID
T.CARD_ID, --卡片ID
COUNT(T.CARD_ID) AS EXPOSURE --点击次数
FROM ML.MID_ML_C_ET_PE_PRECISEEXPOSURE_DIMEN_D T
WHERE T.PARTITION_DAY = '{partition_day}'
AND T.PAGE_CODE = 'search_result_post'
GROUP BY T.DEVICE_ID,
T.CARD_ID) C
left join
(SELECT PARAMS['card_id'] as CARD_ID,device_id as DEVICE_ID, COUNT(PARAMS['card_id']) AS CLICK_NUM
FROM ML.ML_C_ET_CK_CLICK_DIMEN_D T
WHERE T.PARTITION_DAY = '{partition_day}'
AND T.PAGE_CODE = 'search_result_post'
AND T.ACTION IN ('search_result_click_infomation_item','on_click_topic_card')
group by device_id,PARAMS['card_id']) C
group by device_id,PARAMS['card_id']) T
left join
(SELECT T.DEVICE_ID, --设备ID
T.CARD_ID, --卡片ID
SUM(T.CLICK_NUM) AS CLICK_NUM --点击次数
FROM ML.ML_C_ET_CK_CLICK_DIMEN_D T
WHERE T.PARTITION_DAY = '{partition_day}'
AND T.PAGE_CODE = 'search_result_post'
AND T.ACTION IN ('search_result_click_infomation_item','on_click_topic_card')
GROUP BY T.DEVICE_ID
,T.CARD_ID
) T
on C.DEVICE_ID = T.DEVICE_ID AND C.CARD_ID = T.CARD_ID
LEFT JOIN
(
......
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