Commit c2ddc27d by wujicang

Update self_asin_redis.py 新增导出字段

parent b1363229
...@@ -97,7 +97,9 @@ def save_to_doris(df_all: DataFrame): ...@@ -97,7 +97,9 @@ def save_to_doris(df_all: DataFrame):
"other_seller_name", "other_seller_name",
"buy_sales", "buy_sales",
"updated_at", "updated_at",
"img_num" "img_num",
"online_time",
"is_high_return_rate"
) )
write_fields = ",".join(df_all.schema.fieldNames()) write_fields = ",".join(df_all.schema.fieldNames())
...@@ -164,7 +166,8 @@ def export(): ...@@ -164,7 +166,8 @@ def export():
other_seller_name, other_seller_name,
buy_sales, buy_sales,
img_num, img_num,
date_format(updated_at, '%Y-%m-%d %H:%m:%S') updated_at date_format(updated_at, '%Y-%m-%d %H:%m:%S') updated_at,
coalesce(if(returns = 'Customers usually keep this item', 1, 0), 0) as is_high_return_rate
from {site_name}_self_asin_detail from {site_name}_self_asin_detail
where updated_at >= '{last_day}' where updated_at >= '{last_day}'
and updated_at <= '{next_day}' and updated_at <= '{next_day}'
...@@ -221,7 +224,9 @@ def na_fill(asin_df): ...@@ -221,7 +224,9 @@ def na_fill(asin_df):
"account_name": "", "account_name": "",
"other_seller_name": "", "other_seller_name": "",
"buy_sales": "", "buy_sales": "",
"img_num": 0 "img_num": 0,
"online_time": '',
"is_high_return_rate": 0
}) })
pass pass
...@@ -293,7 +298,9 @@ def export_all(): ...@@ -293,7 +298,9 @@ def export_all():
other_seller_name, other_seller_name,
buy_sales, buy_sales,
img_num, img_num,
date_format(updated_at, '%Y-%m-%d %H:%m:%S') updated_at date_format(updated_at, '%Y-%m-%d %H:%m:%S') updated_at,
date_format(online_time, '%Y-%m-%d %H:%m:%S') online_time,
coalesce(if(returns = 'Customers usually keep this item', 1, 0), 0) as is_high_return_rate
from ( from (
select max(id) as max_id select max(id) as max_id
from {site_name}_self_asin_detail from {site_name}_self_asin_detail
......
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