Commit c6d34498 authored by litaolemo's avatar litaolemo

update

parent f513e2e8
......@@ -65,7 +65,7 @@ spark.sql("CREATE TEMPORARY FUNCTION arrayMerge AS 'com.gmei.hive.common.udf.UDF
# huidu_device_id_df = spark.sql(huidu_device_id_sql)
# huidu_device_id_df.createOrReplaceTempView("dev_view")
task_list = []
task_days = 80
task_days = 3
for t in range(0, task_days):
day_num = 0 - t
......
This diff is collapsed.
......@@ -79,8 +79,7 @@ spark.sql("CREATE TEMPORARY FUNCTION is_json AS 'com.gmei.hive.common.udf.UDFJso
spark.sql("CREATE TEMPORARY FUNCTION arrayMerge AS 'com.gmei.hive.common.udf.UDFArryMerge'")
task_days = 2
for t in range(0, 60):
for t in range(6, 7):
day_num = 0 - t
now = (datetime.datetime.now() + datetime.timedelta(days=day_num))
last_30_day_str = (now + datetime.timedelta(days=-30)).strftime("%Y%m%d")
......@@ -839,10 +838,11 @@ for t in range(0, 60):
pid = hashlib.md5((day_id + device_os_type + active_type + card_content_type + recommend_type).encode("utf8")).hexdigest()
try:
card_click_diff = data_dict.get(pid) - card_click
print(card_click_diff)
card_click += card_click_diff
card_exposure += card_click_diff
click_ctr = round(card_click/card_exposure,5)
if card_click_diff:
print(card_click_diff)
card_click += card_click_diff
card_exposure += card_click_diff
click_ctr = round(card_click/card_exposure,5)
except:
print("add error")
instert_sql = """replace into recommend_strategy_d_fix(
......
......@@ -4,12 +4,6 @@
# @email : litao@igengmei.com
# @author : litao
# -*- coding:UTF-8 -*-
# @Time : 2020/9/4 17:07
# @File : search_meigou_ctr.py
# @email : litao@igengmei.com
# @author : litao
import hashlib
import json
......
This diff is collapsed.
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