Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
meta_base_code
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黎涛
meta_base_code
Commits
0fb4de8f
Commit
0fb4de8f
authored
Sep 08, 2020
by
litaolemo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
4c15a8f0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
14 deletions
+13
-14
search_tractate_ctr.py
task/search_tractate_ctr.py
+13
-14
No files found.
task/search_tractate_ctr.py
View file @
0fb4de8f
...
...
@@ -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
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment