Commit 5c9c7152 by chenyuanjie

asin信息库-隐藏分类表调整

parent 20746c11
......@@ -90,7 +90,8 @@ class DwtAiAsin(object):
"""
self.df_base_asin = self.spark.sql(sql1).repartition(40, 'asin')
# 禁用分类过滤(category_id + category 双重)
# 禁用分类过滤(category_id + category 双重):category_disable_config是多模块共用配置表,
# 必须按module过滤只取信息库自己的配置,不然会连流量选品等其他模块的禁用分类一起过滤掉
conn_info = DBUtil.get_connection_info("mysql", "us")
sql_cat_id = f"""
SELECT DISTINCT category_id FROM category_full_name a
......@@ -99,6 +100,7 @@ class DwtAiAsin(object):
WHERE b.id_path IS NOT NULL
AND a.id_path LIKE CONCAT(b.id_path, '%')
AND a.site = b.site
AND b.module = '信息库:名称前缀筛选'
) AND a.site = '{self.site_name}'
"""
df_filter_cat_id = SparkUtil.read_jdbc_query(
......@@ -107,7 +109,7 @@ class DwtAiAsin(object):
sql_cat_desc = f"""
SELECT DISTINCT name_path AS category FROM category_disable_config
WHERE site = '{self.site_name}'
WHERE site = '{self.site_name}' AND module = '信息库:名称前缀筛选'
"""
df_filter_cat_desc = SparkUtil.read_jdbc_query(
self.spark, conn_info["url"], conn_info["pwd"], conn_info["username"], sql_cat_desc
......
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