@@ -78,17 +79,11 @@ spark.sql("CREATE TEMPORARY FUNCTION json_map AS 'brickhouse.udf.json.JsonMapUDF
spark.sql("CREATE TEMPORARY FUNCTION is_json AS 'com.gmei.hive.common.udf.UDFJsonFormatCheck'")
spark.sql("CREATE TEMPORARY FUNCTION arrayMerge AS 'com.gmei.hive.common.udf.UDFArryMerge'")
ungrey_select_sql="""SELECT *,NVL(ROUND(wel_click_pv/wel_exp_pv,6),0) as meigou_ctr,
NVL(ROUND(content_click_pv/content_exp_pv,6),0) as neirong_ctr FROM pm.tl_pm_contentpage_ctr where grey_type = '非灰'"""
ungrey_df=spark.sql(ungrey_select_sql)
ungrey_df.createOrReplaceTempView("ungrey")
grey_select_sql="""SELECT *,NVL(ROUND(wel_click_pv/wel_exp_pv,6),0) as grey_meigou_ctr,
NVL(ROUND(content_click_pv/content_exp_pv,6),0) as grey_neirong_ctr FROM pm.tl_pm_contentpage_ctr where grey_type = '灰度'"""
grey_df=spark.sql(grey_select_sql)
grey_df.createOrReplaceTempView("grey")
grey_select_sql="""SELECT *,NVL(ROUND((navbar_search+highlight_word+self_welfare_card+recommend_welfare_card+recommend_content_card*0.2+transfer_card+video_consultation)/card_exposure,5),0) as recommend_ctr,
NVL(ROUND(card_click/card_exposure,5),0) as click_ctr,
NVL(ROUND((navbar_search+highlight_word+self_welfare_card+recommend_welfare_card+recommend_content_card*0.2+transfer_card+video_consultation)/card_click,5),0) as second_jump_ctr, FROM pm.tl_pm_recommend_strategy_d"""
device_df=spark.sql(grey_select_sql)
sql="""SELECT *,ungrey.meigou_ctr,ungrey.neirong_ctr from grey"""