SELECT NVL(t2.partition_date,t3.partition_date) as partition_date
# SELECT NVL(t2.partition_date,t3.partition_date) as partition_date
,NVL(t2.cl_id,t3.cl_id) as cl_id
# ,NVL(t2.cl_id,t3.cl_id) as cl_id
,NVL(t2.query,t3.query) as query
# ,NVL(t2.query,t3.query) as query
,NVL(t2.pv,0) as hexin
# ,NVL(t2.pv,0) as hexin
,NVL(t3.pv,0) as neirong
# ,NVL(t3.pv,0) as neirong
FROM
# FROM
(--核心卡片点击
# (--核心卡片点击
SELECT partition_date
# SELECT partition_date
,params['query'] as query
# ,params['query'] as query
,cl_id
# ,cl_id
,count(1) as pv
# ,count(1) as pv
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 ('search_result_click_recommend_item','search_result_welfare_click_item','search_result_hospital_click_item','search_result_doctor_click_item','on_click_doctor_card', 'on_click_hospital_card')
# AND ((action in ('search_result_click_recommend_item','search_result_welfare_click_item','search_result_hospital_click_item','search_result_doctor_click_item','on_click_doctor_card', 'on_click_hospital_card')
AND page_name in ('search_result_more','search_result_welfare','search_result_hospital','search_result_doctor'))
# AND page_name in ('search_result_more','search_result_welfare','search_result_hospital','search_result_doctor'))
or (action = 'goto_welfare_detail' AND params [ 'from' ] = 'search_result_welfare_recommend')
# or (action = 'goto_welfare_detail' AND params [ 'from' ] = 'search_result_welfare_recommend')
or (action = 'on_click_card' AND params['card_content_type'] in ('service','hospital','doctor') AND page_name in ('search_result_more','search_result_welfare','search_result_hospital','search_result_doctor'))
# or (action = 'on_click_card' AND params['card_content_type'] in ('service','hospital','doctor') AND page_name in ('search_result_more','search_result_welfare','search_result_hospital','search_result_doctor'))
or (action = 'on_click_button' AND params['button_name'] = 'check_plan' AND page_name = 'search_result_more'))
# or (action = 'on_click_button' AND params['button_name'] = 'check_plan' AND page_name = 'search_result_more'))
GROUP BY partition_date
# GROUP BY partition_date
,params['query']
# ,params['query']
,cl_id
# ,cl_id
)t2
# )t2
FULL JOIN
# FULL JOIN
(--内容卡片点击
# (--内容卡片点击
SELECT partition_date
# SELECT partition_date
,params['query'] as query
# ,params['query'] as query
,cl_id
# ,cl_id
,count(1) as pv
# ,count(1) as pv
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 ('on_click_topic_card','on_click_diary_card','search_result_click_infomation_item')
# AND ((action in ('on_click_topic_card','on_click_diary_card','search_result_click_infomation_item')
AND page_name in ('search_result_more','search_result_diary','search_result_post'))
# AND page_name in ('search_result_more','search_result_diary','search_result_post'))
or (action = 'on_click_card' AND params['card_content_type'] in ('answer','diary') AND page_name in ('search_result_more','search_result_diary','search_result_question_answer')))
# or (action = 'on_click_card' AND params['card_content_type'] in ('answer','diary') AND page_name in ('search_result_more','search_result_diary','search_result_question_answer')))