Slackbot
06/20/2023, 6:33 PMKyle Hoondert
06/20/2023, 6:36 PMsys.tasks
table like:
WITH tasks AS (
SELECT "task_id", "group_id", "type", "datasource", "created_time", "location", "duration", "error_msg",
CAST (LEFT(created_time,10) || ' ' || RIGHT(LEFT(created_time,19),8) AS TIMESTAMP) AS __time,
CASE WHEN "error_msg" = 'Shutdown request from user' THEN 'CANCELED' WHEN "status" = 'RUNNING' THEN "runner_status" ELSE "status" END as "status"
FROM sys.tasks
)
SELECT __time, "task_id", "status", "group_id", "type", "datasource", "created_time", "location", "duration", "error_msg",
TIMESTAMPDIFf(MINUTE, __time, CURRENT_TIMESTAMP) as time_diff
FROM tasks
You should be able to use this script-fu on the times in sys.segments
Kyle Hoondert
06/20/2023, 6:39 PMselect CAST (LEFT("start",10) || ' ' || RIGHT(LEFT("start",19),8) AS TIMESTAMP) AS __time from sys.segments
JRob
06/20/2023, 6:44 PM