Commit d22aa05c authored by litaolemo's avatar litaolemo

update

parent 719e83b5
......@@ -178,30 +178,41 @@ WHERE spam_pv.device_id IS NULL
new_urser_device_id_df.createOrReplaceTempView("device_id_view")
new_urser_device_id_df.show(1)
sql_res = new_urser_device_id_df.collect()
res_dict = {}
portrait_dict = {
"first_demands": {},
"second_demands": {},
"first_solutions": {},
"second_solutions": {},
"first_positions": {},
"second_positions": {},
"projects": {},
}
print("-------------------------------")
for count, res in enumerate(sql_res):
count_not_has_portratit = 0
for count_user_count, res in enumerate(sql_res):
# print(count, res)
portratit_res = get_user_portrait_tag3_from_redis(res.device_id)
print(count, res, portratit_res)
# res_dict = {}
#
# print(count_user_count, res, portratit_res)
temp_count = 0
for demand in portratit_res:
if portratit_res[demand]:
for tag in portratit_res[demand][0:3]:
if tag in portrait_dict[demand]:
portrait_dict[demand][tag] += 1
else:
portrait_dict[demand][tag] = 1
temp_count += 1
if not temp_count:
count_not_has_portratit += 1
print(portrait_dict)
print(count_user_count+1,count_not_has_portratit)
print("-------------------------------")
# for count, res in enumerate(sql_res):
# # print(count, res)
# track = res.track
# if not track:
# continue
# track_list = track.split(",")
# for one_key_word in track_list:
# if one_key_word in res_dict:
# res_dict[one_key_word] += 1
# else:
# res_dict[one_key_word] = 1
# print(res_dict)
#
# exception_list = ("report_status","is_open_push")
# for action in res_dict:
# partition_date = yesterday_str
# pid = hashlib.md5((partition_date + action).encode("utf8")).hexdigest()
......
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