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
d9ddf204
Commit
d9ddf204
authored
Aug 28, 2020
by
litaolemo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
a812f582
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
search_strategy_d.py
task/search_strategy_d.py
+10
-10
No files found.
task/search_strategy_d.py
View file @
d9ddf204
...
@@ -173,18 +173,18 @@ for t in range(0, task_days):
...
@@ -173,18 +173,18 @@ for t in range(0, task_days):
SELECT user_id,partition_date,
SELECT user_id,partition_date,
if(size(device_list) > 0, device_list [ 0 ], '') AS device_id
if(size(device_list) > 0, device_list [ 0 ], '') AS device_id
FROM online.ml_user_updates
FROM online.ml_user_updates
WHERE partition_date>='
${start_date}' AND partition_date<'${end_date
}'
WHERE partition_date>='
{yesterday_str}' AND partition_date<'{today_str
}'
)t1
)t1
JOIN
JOIN
(
(
SELECT distinct user_id
SELECT distinct user_id
FROM online.tl_hdfs_doctor_view
FROM online.tl_hdfs_doctor_view
WHERE partition_date = '
${partition_date
}'
WHERE partition_date = '
{yesterday_str
}'
UNION ALL
UNION ALL
SELECT user_id
SELECT user_id
FROM ml.ml_c_ct_ui_user_dimen_d
FROM ml.ml_c_ct_ui_user_dimen_d
WHERE partition_day = '
${partition_date
}'
WHERE partition_day = '
{yesterday_str
}'
AND (is_puppet = 'true' or is_classifyuser = 'true')
AND (is_puppet = 'true' or is_classifyuser = 'true')
UNION ALL
UNION ALL
...
@@ -198,13 +198,13 @@ for t in range(0, task_days):
...
@@ -198,13 +198,13 @@ for t in range(0, task_days):
SELECT user_id, v.device_id as device_id
SELECT user_id, v.device_id as device_id
FROM online.ml_user_history_detail
FROM online.ml_user_history_detail
LATERAL VIEW EXPLODE(device_history_list) v AS device_id
LATERAL VIEW EXPLODE(device_history_list) v AS device_id
WHERE partition_date = '
${partition_date
}'
WHERE partition_date = '
{yesterday_str
}'
)t1
)t1
JOIN
JOIN
(
(
SELECT device_id
SELECT device_id
FROM online.ml_device_history_detail
FROM online.ml_device_history_detail
WHERE partition_date = '
${partition_date
}'
WHERE partition_date = '
{yesterday_str
}'
AND is_login_doctor = '1'
AND is_login_doctor = '1'
)t2
)t2
ON t1.device_id = t2.device_id
ON t1.device_id = t2.device_id
...
@@ -299,18 +299,18 @@ and (dev.device_id is NULL or dev.device_id='')
...
@@ -299,18 +299,18 @@ and (dev.device_id is NULL or dev.device_id='')
SELECT user_id,partition_date,
SELECT user_id,partition_date,
if(size(device_list) > 0, device_list [ 0 ], '') AS device_id
if(size(device_list) > 0, device_list [ 0 ], '') AS device_id
FROM online.ml_user_updates
FROM online.ml_user_updates
WHERE partition_date>='
${start_date}' AND partition_date<'${end_date
}'
WHERE partition_date>='
{yesterday_str}' AND partition_date<'{today_str
}'
)t1
)t1
JOIN
JOIN
(
(
SELECT distinct user_id
SELECT distinct user_id
FROM online.tl_hdfs_doctor_view
FROM online.tl_hdfs_doctor_view
WHERE partition_date = '
${partition_date
}'
WHERE partition_date = '
{yesterday_str
}'
UNION ALL
UNION ALL
SELECT user_id
SELECT user_id
FROM ml.ml_c_ct_ui_user_dimen_d
FROM ml.ml_c_ct_ui_user_dimen_d
WHERE partition_day = '
${partition_date
}'
WHERE partition_day = '
{yesterday_str
}'
AND (is_puppet = 'true' or is_classifyuser = 'true')
AND (is_puppet = 'true' or is_classifyuser = 'true')
UNION ALL
UNION ALL
...
@@ -324,13 +324,13 @@ and (dev.device_id is NULL or dev.device_id='')
...
@@ -324,13 +324,13 @@ and (dev.device_id is NULL or dev.device_id='')
SELECT user_id, v.device_id as device_id
SELECT user_id, v.device_id as device_id
FROM online.ml_user_history_detail
FROM online.ml_user_history_detail
LATERAL VIEW EXPLODE(device_history_list) v AS device_id
LATERAL VIEW EXPLODE(device_history_list) v AS device_id
WHERE partition_date = '
${partition_date
}'
WHERE partition_date = '
{yesterday_str
}'
)t1
)t1
JOIN
JOIN
(
(
SELECT device_id
SELECT device_id
FROM online.ml_device_history_detail
FROM online.ml_device_history_detail
WHERE partition_date = '
${partition_date
}'
WHERE partition_date = '
{yesterday_str
}'
AND is_login_doctor = '1'
AND is_login_doctor = '1'
)t2
)t2
ON t1.device_id = t2.device_id
ON t1.device_id = t2.device_id
...
...
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