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
73827f33
Commit
73827f33
authored
Sep 01, 2020
by
litaolemo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
a015ed4a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
search_strategy_d.py
task/search_strategy_d.py
+15
-15
No files found.
task/search_strategy_d.py
View file @
73827f33
...
@@ -99,7 +99,7 @@ for t in range(0, task_days):
...
@@ -99,7 +99,7 @@ for t in range(0, task_days):
,NVL(t3.search_uv,0) as uv
,NVL(t3.search_uv,0) as uv
FROM
FROM
(
(
SELECT
t.active_type,t.device_os_type,t.channel,t.search_pv,t.
search_uv FROM
SELECT
active_type,device_os_type,channel,search_pv,
search_uv FROM
(
(
SELECT active_type,device_os_type,channel
SELECT active_type,device_os_type,channel
,count(t1.cl_id) as search_pv
,count(t1.cl_id) as search_pv
...
@@ -108,15 +108,15 @@ for t in range(0, task_days):
...
@@ -108,15 +108,15 @@ for t in range(0, task_days):
(
(
SELECT partition_date,cl_id
SELECT partition_date,cl_id
FROM online.bl_hdfs_maidian_updates
FROM online.bl_hdfs_maidian_updates
WHERE partition_date >=
{yesterday_str}
WHERE partition_date >=
'{yesterday_str}'
AND partition_date <
{today_str}
AND partition_date <
'{today_str}'
AND action in ('do_search','search_result_click_search')
AND action in ('do_search','search_result_click_search')
UNION ALL
UNION ALL
SELECT cl_id
SELECT cl_id
FROM online.bl_hdfs_maidian_updates
FROM online.bl_hdfs_maidian_updates
WHERE partition_date >=
{yesterday_str}
WHERE partition_date >=
'{yesterday_str}'
AND partition_date <
{today_str}
AND partition_date <
'{today_str}'
AND action = 'on_click_card'
AND action = 'on_click_card'
AND params['page_name']='search_home'
AND params['page_name']='search_home'
...
@@ -124,8 +124,8 @@ for t in range(0, task_days):
...
@@ -124,8 +124,8 @@ for t in range(0, task_days):
SELECT partition_date
SELECT partition_date
,cl_id
,cl_id
FROM online.bl_hdfs_maidian_updates
FROM online.bl_hdfs_maidian_updates
WHERE partition_date >=
{yesterday_str}
WHERE partition_date >=
'{yesterday_str}'
AND partition_date <
{today_str}
AND partition_date <
'{today_str}'
AND action = 'on_click_card'
AND action = 'on_click_card'
AND params['in_page_pos']='猜你喜欢'
AND params['in_page_pos']='猜你喜欢'
AND params['tab_name']='精选'
AND params['tab_name']='精选'
...
@@ -136,8 +136,8 @@ for t in range(0, task_days):
...
@@ -136,8 +136,8 @@ for t in range(0, task_days):
SELECT partition_date
SELECT partition_date
,cl_id
,cl_id
FROM online.bl_hdfs_maidian_updates
FROM online.bl_hdfs_maidian_updates
WHERE partition_date >=
{yesterday_str}
WHERE partition_date >=
'{yesterday_str}'
AND partition_date <
{today_str}
AND partition_date <
'{today_str}'
AND action = 'on_click_card'
AND action = 'on_click_card'
AND page_name='welfare_home'
AND page_name='welfare_home'
AND params['card_type'] ='search_word'
AND params['card_type'] ='search_word'
...
@@ -147,8 +147,8 @@ for t in range(0, task_days):
...
@@ -147,8 +147,8 @@ for t in range(0, task_days):
SELECT partition_date
SELECT partition_date
,cl_id
,cl_id
FROM online.bl_hdfs_maidian_updates
FROM online.bl_hdfs_maidian_updates
WHERE partition_date >=
{yesterday_str}
WHERE partition_date >=
'{yesterday_str}'
AND partition_date <
{today_str}
AND partition_date <
'{today_str}'
AND int(split(app_version,'\\.')[1]) >= 27
AND int(split(app_version,'\\.')[1]) >= 27
AND action='on_click_card'
AND action='on_click_card'
AND params['card_type']='highlight_word'
AND params['card_type']='highlight_word'
...
@@ -168,11 +168,11 @@ for t in range(0, task_days):
...
@@ -168,11 +168,11 @@ for t in range(0, task_days):
LEFT JOIN
LEFT JOIN
(SELECT code,is_ai_channel,partition_day
(SELECT code,is_ai_channel,partition_day
FROM DIM.DIM_AI_CHANNEL_ZP_NEW
FROM DIM.DIM_AI_CHANNEL_ZP_NEW
WHERE partition_day>=
{yesterday_str}
WHERE partition_day>=
'{yesterday_str}'
AND partition_day <
{today_str}
) tmp
AND partition_day <
'{today_str}'
) tmp
ON m.partition_date=tmp.partition_day AND first_channel_source_type=code
ON m.partition_date=tmp.partition_day AND first_channel_source_type=code
WHERE partition_date >=
{yesterday_str}
WHERE partition_date >=
'{yesterday_str}'
AND partition_date <
{today_str}
AND partition_date <
'{today_str}'
AND active_type in ('1','2','4')
AND active_type in ('1','2','4')
) mas
) mas
LATERAL VIEW explode(mas.channel) t2 AS channel
LATERAL VIEW explode(mas.channel) t2 AS channel
...
...
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