Commit c62a2353 by chenyuanjie

流量选品30天,价格-1置空

parent 51908cbf
...@@ -247,6 +247,7 @@ class KafkaFlowAsinDetail(Templates): ...@@ -247,6 +247,7 @@ class KafkaFlowAsinDetail(Templates):
# 3. 处理bsr销量、价格类型字段以及BSR销售额信息 # 3. 处理bsr销量、价格类型字段以及BSR销售额信息
def handle_asin_bsr_orders(self, df): def handle_asin_bsr_orders(self, df):
df = df.withColumn("price", F.when(F.col("price") < 0, F.lit(None)).otherwise(F.col("price")))
df = df.join(self.df_bs_report, on=['asin_bs_cate_1_id', 'asin_bs_cate_1_rank'], how='left') df = df.join(self.df_bs_report, on=['asin_bs_cate_1_id', 'asin_bs_cate_1_rank'], how='left')
df = df.withColumn("price_type", F.expr(""" df = df.withColumn("price_type", F.expr("""
CASE WHEN price IS NOT NULL AND price > 0 AND price < 10 THEN 1 WHEN price >= 10 AND price < 15 THEN 2 CASE WHEN price IS NOT NULL AND price > 0 AND price < 10 THEN 1 WHEN price >= 10 AND price < 15 THEN 2
......
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