Browse Source

MOD:dw_channel 更新方式修改

cxyu 3 years ago
parent
commit
fe802dac61
1 changed files with 3 additions and 4 deletions
  1. 3 4
      app/etl/dw/dw_channel_daily.py

+ 3 - 4
app/etl/dw/dw_channel_daily.py

@@ -69,11 +69,10 @@ left outer join
     having order_amount+cost+reg_order_amount>0"""
 
     data = ck.execute(sql)
-    isql = "insert into dw_channel values (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)"
-    db.dm.execute("truncate table dw_channel")
+    isql = "replace into dw_channel values (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)"
+    # db.dm.execute("truncate table dw_channel")
     db.dm.executeMany(isql, data)
 
-
 def dw_channel_user_daily():
     sql = """
 select toDate(formatDateTime(reg_time,'%Y-%m-%d')) as dt,
@@ -222,7 +221,7 @@ def dw_channel_daily():
     logging.info('run> dw_channel')
     logging.info('公众号基本数据处理,开始')
     dw_channel()  # 公众号基本数据
-    logging.info('公众号基本数据处理,开始')
+    logging.info('公众号基本数据处理,结束')
 
     logging.info('用户激活数据处理,开始')
     dw_channel_user_daily()  # 用户激活