renyupeng 3 anos atrás
pai
commit
820b573db1

+ 3 - 0
Apietl/kwai_etl/report/CampaignDailyReport.py

@@ -209,6 +209,7 @@ class CampaignDailyReport:
              on report.advertiser_id = sys.account_id
         where report.stat_date between {start_time} and {end_time} order by campaign_id,stat_date limit {num},20000""". \
                     format(start_time=self.start_time, end_time=self.end_time, num=i * 20000)
+                print(sql)
                 TidbConn.exec_sql(self.conn, sql)
                 self.conn.commit()
             return 0
@@ -221,5 +222,7 @@ if __name__ == '__main__':
     status = CampaignDailyReport().daily_report()
     if status == 0:
         print("作业执行成功")
+        exit(0)
     else:
         print("作业执行失败")
+        exit(-1)

+ 3 - 0
Apietl/kwai_etl/report/CampaignHourlyReport.py

@@ -208,6 +208,7 @@ class CampaignHourlyReport:
              on report.advertiser_id = sys.account_id
         where report.stat_date between {start_time} and {end_time} order by campaign_id,stat_date,`hour` limit {num},20000""". \
                     format(start_time=self.start_time, end_time=self.end_time, num=i * 20000)
+                print(sql)
                 TidbConn.exec_sql(self.conn, sql)
                 self.conn.commit()
             return 0
@@ -220,5 +221,7 @@ if __name__ == '__main__':
     status = CampaignHourlyReport().hourly_report()
     if status == 0:
         print("作业执行成功")
+        exit(0)
     else:
         print("作业执行失败")
+        exit(-1)

+ 2 - 0
Apietl/kwai_etl/report/MateirialVideoDailyReport.py

@@ -295,5 +295,7 @@ if __name__ == '__main__':
     status = MateirialVideoDailyReport().daily_report()
     if status == 0:
         print("作业执行成功")
+        exit(0)
     else:
         print("作业执行失败")
+        exit(-1)

+ 3 - 0
Apietl/kwai_etl/report/MateirialVideoHourlyReport.py

@@ -282,6 +282,7 @@ from media_api.kuaishou_material_video_report_hourly report
  where report.stat_date between {start_time} and {end_time} and  report.photo_id!=0
   order by advertiser_id,photo_id ,stat_date,`hour` limit {num},20000""".format(
                     start_time=self.start_time, end_time=self.end_time, num=i * 20000)
+                print(sql)
                 TidbConn.exec_sql(self.conn, sql)
                 self.conn.commit()
             return 0
@@ -294,5 +295,7 @@ if __name__ == '__main__':
     status = MateirialVideoHourlyReport().hourly_report()
     if status == 0:
         print("作业执行成功")
+        exit(0)
     else:
         print("作业执行失败")
+        exit(-1)

+ 3 - 0
Apietl/kwai_etl/report/UnitDailyReport.py

@@ -211,6 +211,7 @@ class UnitDailyReport:
              on report.advertiser_id = sys.account_id
         where report.stat_date between {start_time} and {end_time} order by unit_id,stat_date limit {num},20000""".\
                     format(start_time=self.start_time, end_time=self.end_time, num=i * 20000)
+                print(sql)
                 TidbConn.exec_sql(self.conn, sql)
                 self.conn.commit()
             return 0
@@ -223,5 +224,7 @@ if __name__ == '__main__':
     status = UnitDailyReport().daily_report()
     if status == 0:
         print("作业执行成功")
+        exit(0)
     else:
         print("作业执行失败")
+        exit(-1)

+ 3 - 0
Apietl/kwai_etl/report/UnitHourlyReport.py

@@ -213,6 +213,7 @@ class UnitHourlyReport:
              on report.advertiser_id = sys.account_id
         where report.stat_date between {start_time} and {end_time} order by unit_id,hour,stat_date limit {num},20000""".\
                     format(start_time=self.start_time, end_time=self.end_time,num=i * 20000)
+                print(sql)
                 TidbConn.exec_sql(self.conn, sql)
                 self.conn.commit()
             return 0
@@ -225,5 +226,7 @@ if __name__ == '__main__':
     status = UnitHourlyReport().hourly_report()
     if status == 0:
         print("作业执行成功")
+        exit(0)
     else:
         print("作业执行失败")
+        exit(-1)