Commit 7e007607 by chenyuanjie

fix

parent d6f0567c
......@@ -53,7 +53,8 @@ class ExportAsinDetailBase(object):
asin_price,
asin_rating,
asin_total_comments,
asin_launch_time_type
asin_launch_time_type,
asin_describe
from dwt_flow_asin
where site_name = '{self.site_name}'
and date_type = '{self.date_type}'
......@@ -952,6 +953,8 @@ class ExportAsinDetailBase(object):
select
asin,
review_json_list,
product_json,
product_detail_json,
updated_at
from ods_asin_detail
where site_name = '{self.site_name}'
......@@ -982,12 +985,13 @@ class ExportAsinDetailBase(object):
F.col("category_first_id").alias("category_id"), F.col("category_id").alias("category_current_id"), "parent_asin",
F.col("first_category_rank").alias("bsr_rank"), F.col("asin_price").alias("price"), F.col("asin_rating").alias("rating"),
F.col("asin_total_comments").alias("total_comments"), "seller_id", "fb_country_name", "review_json_list",
F.col("asin_launch_time_type").alias("launch_time_type")
F.col("asin_launch_time_type").alias("launch_time_type"), F.col("asin_describe").alias("describe"),
"product_json", "product_detail_json"
).repartition(40, 'asin')
def save_data(self):
con_info = DBUtil.get_connection_info('postgresql', 'us')
table_name = f'ai_asin_detail_month_{self.date_info.replace("-", "_")}'
table_name = f'ai_asin_detail_month_{self.date_info.replace("-", "_")}_copy'
self.df_save.write.format("jdbc") \
.option("url", con_info["url"]) \
.option("dbtable", table_name) \
......
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