使用 CREATE JOB 创建任务,始终无法正常调度,无论是一次性任务还是定时任务。
JOB 本身能够正常创建,select * from jobs("type"="insert")
能够查到 JOB 信息,任务处于 RUNNING
状态;
但是 select * from tasks("type"="insert")
结果为空,没有创建 task,任务没有正常被调度执行。
能否帮忙排查下呢,谢谢?
版本: 2.1.0
OS: Linux
参考文档链接:CREATE JOB
创建 JOB 的 SQL 语句如下,DO 关键字后面的 INSERT INTO
子句,单独执行时是可以正常向目标表插入数据的,目标表为内表:
CREATE JOB sync_dwd_page_click_da ON SCHEDULE EVERY 5 MINUTE
DO
INSERT INTO opc.dwd_page_click_da SELECT
CURDATE() AS dt,
TO_DATE(FROM_UNIXTIME( oet.time / 1000 )) AS date,
FROM_UNIXTIME( oet.time / 1000 ) AS TIME,
JSON_EXTRACT( properties, '$.$_user_id' ) AS user_id,
JSON_EXTRACT( properties, '$.$_app_key' ) AS app_key,
JSON_EXTRACT( properties, '$.$_org_name' ) AS org_name,
JSON_EXTRACT( properties, '$.$url' ) AS url,
JSON_EXTRACT( properties, '$.$element_path' ) AS element_path,
JSON_EXTRACT( properties, '$.$element_type' ) AS element_type,
JSON_EXTRACT( properties, '$.$_element_name' ) AS element_name,
JSON_EXTRACT( properties, '$.$title' ) AS title
FROM
opc.ods_event_track oet
WHERE
TIME < UNIX_TIMESTAMP( CURDATE()) * 1000 AND TIME >= UNIX_TIMESTAMP( CURDATE() - 1 ) * 1000
AND EVENT = "$WebClick"
AND JSON_EXTRACT( properties, '$.$_user_id' ) IS NOT NULL
AND JSON_EXTRACT( properties, '$.$_app_key' ) IS NOT NULL
AND JSON_EXTRACT( properties, '$.$_org_name' ) IS NOT NULL
执行 select * from jobs("type"="insert")
能够查到 JOB 信息,状态为 RUNNING
,但 ExecuteSql
属性以 ATE JOB
开头而不是以 CREATE JOB
开头:
执行 select * from tasks("type"="insert")
结果为空,没有创建 task。
能够帮忙排查下呢,谢谢