Commit d9ddf204 authored by litaolemo's avatar litaolemo

update

parent a812f582
...@@ -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
......
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