From 7cb4429175572f200077452fcc5a32a7d1f8fa65 Mon Sep 17 00:00:00 2001 From: Joseph White Date: Tue, 29 Sep 2020 15:54:37 -0400 Subject: [PATCH] Fix jobscript ingestion sql. If the jobscript mode was set to define timestamp_mode then the code generated sql with a syntax error. This caused jobscript data to be erroneously replaced with a '0'. --- src/supremm/ingest_jobscripts.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/supremm/ingest_jobscripts.py b/src/supremm/ingest_jobscripts.py index f51f2580..ca145b40 100755 --- a/src/supremm/ingest_jobscripts.py +++ b/src/supremm/ingest_jobscripts.py @@ -47,8 +47,7 @@ def __init__(self, dwconfig, schema, timestamp_mode): `modw`.`job_tasks` WHERE resource_id = %s - AND local_job_id_raw = %s - ON DUPLICATE KEY UPDATE script = script""" + AND local_job_id_raw = %s""" if self.timestamp_mode == 'start': self.query += ' AND ABS(DATEDIFF(DATE(FROM_UNIXTIME(start_time_ts)), %s)) < 2' @@ -59,6 +58,8 @@ def __init__(self, dwconfig, schema, timestamp_mode): #else # self.timestamp_mode == 'None' which means no date restrictions + self.query += " ON DUPLICATE KEY UPDATE resource_id = VALUES(resource_id), start_date = VALUES(start_date), script = VALUES(script)" + self.buffered = 0 def insert(self, data):