Commit b3da204d authored by 高雅喆's avatar 高雅喆

删除部分轻医美标签词

parent b404a648
......@@ -17,6 +17,7 @@ import numpy as np
import pandas as pd
from pyspark.sql.functions import lit
from pyspark.sql.functions import concat_ws
from tool import *
def send_email(app,id,e):
......@@ -52,6 +53,25 @@ def send_email(app,id,e):
print('error')
def get_hot_search_words_tag():
try:
hot_search = """
SELECT a.keywords,
b.id,
b.tag_type
FROM api_hot_search_words a
LEFT JOIN api_tag b ON a.keywords=b.name
WHERE a.is_delete=0
AND b.tag_type+0<'4'+0
AND b.is_online=1
ORDER BY a.sorted DESC LIMIT 10
"""
mysql_results = get_data_by_mysql('172.16.30.141', 3306, 'work', 'BJQaT9VzDcuPBqkd', 'zhengxing', hot_search)
return mysql_results
except Exception as e:
print(e)
return []
def get_user_history_order_service_tag(user_id):
try:
if user_id:
......@@ -139,6 +159,7 @@ if __name__ == '__main__':
redis_client.hmset(hot_search_words_portrait_portrait_key3, hot_search_words_portrait3_dict)
# rdd
spark.sparkContext.addPyFile("/srv/apps/ffm-baseline_git/eda/smart_rank/tool.py")
sparkConf = SparkConf().set("spark.hive.mapred.supports.subdirectories", "true") \
.set("spark.hadoop.mapreduce.input.fileinputformat.input.dir.recursive", "true") \
.set("spark.tispark.plan.allow_index_double_read", "false") \
......
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