Commit 4ad33c30 authored by litaolemo's avatar litaolemo

update

parent 46903334
......@@ -105,7 +105,7 @@ for t in range(1, task_days):
one_week_age_str = (now + datetime.timedelta(days=-7)).strftime("%Y%m%d")
new_urser_device_id_sql = r"""
select t2.device_id as device_id from
(select device_id from online.ml_device_day_active_status where partition_date = '${today_str}' and active_type in (1,2)) t2
(select device_id from online.ml_device_day_active_status where partition_date = '{today_str}' and active_type in (1,2)) t2
LEFT JOIN
(
select distinct device_id
......@@ -195,7 +195,6 @@ WHERE spam_pv.device_id IS NULL
for count_user_count, res in enumerate(sql_res):
# print(count, res)
portratit_res = get_user_portrait_tag3_from_redis(res.device_id)
portratit_res
# print(count_user_count, res, portratit_res)
temp_count = 0
......
......@@ -86,7 +86,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_list = []
task_days = 30
task_days = 8
name_dict = {
"/api/my_order/recommend/service/list": "我的订单页推荐美购列表",
......@@ -870,7 +870,7 @@ for t in range(1, task_days):
one_week_age_str = (now + datetime.timedelta(days=-7)).strftime("%Y%m%d")
new_urser_device_id_sql = r"""
select t2.device_id as device_id from
(select device_id from online.ml_device_day_active_status where partition_date = '${today_str}' and active_type in (1,2)) t2
(select device_id from online.ml_device_day_active_status where partition_date = '{today_str}' and active_type in (1,2)) t2
LEFT JOIN
(
select distinct device_id
......@@ -954,7 +954,7 @@ WHERE spam_pv.device_id IS NULL
left join
(select cl_id, concat_ws(',', collect_list(action)) as track from
(select * from online.bl_hdfs_maidian_updates where partition_date = {partition_date} and cl_id is not null ) group by cl_id) t2
on t1.device_id = t2.cl_id""".format(partition_date=yesterday_str)
on t1.device_id = t2.cl_id""".format(partition_date=today_str)
print(maidian_sql)
track_df = spark.sql(maidian_sql)
# track_df.createOrReplaceTempView("device_id_view")
......
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