KnowStreaming icon indicating copy to clipboard operation
KnowStreaming copied to clipboard

start_time not set when create reassign job

Open Mengqi777 opened this issue 3 years ago • 2 comments

Error updating database. Cause: java.sql.SQLIntegrityConstraintViolationException: (conn=2622) Column 'start_time' cannot be null ### The error may exist in URL [jar:file:/search/odin/kafka/KnowStreaming/libs/ks-km.jar!/BOOT-INF/lib/km-persistence-3.0.0-beta.jar!/mybatis/ReassignJob.xml] ### The error may involve com.xiaojukeji.know.streaming.km.persistence.mysql.reassign.ReassignJobDAO.addAndSetId-Inline ### The error occurred while setting parameters ### SQL: INSERT INTO ks_km_reassign_job (id, cluster_phy_id, reassignment_json, description, throttle_unit_byte, start_time, finished_time, creator, status) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) ### Cause: java.sql.SQLIntegrityConstraintViolationException: (conn=2622) Column 'start_time' cannot be null ; (conn=2622) Column 'start_time' cannot be null; nested exception is java.sql.SQLIntegrityConstraintViolationException: (conn=2622) Column 'start_time' cannot be null

Mengqi777 avatar Sep 16 '22 07:09 Mengqi777

使用的KS版本是?

ZQKC avatar Sep 19 '22 10:09 ZQKC

自己编译的dev版本部署的。

虽然mysql建表语句中设置了NOT NULL DEFAULT '1971-1-1 00:00:00'

`start_time` timestamp NOT NULL DEFAULT '1971-1-1 00:00:00' COMMENT '任务开始时间',
`finished_time` timestamp NOT NULL DEFAULT '1971-1-1 00:00:00' COMMENT '任务完成时间',

但实际运行的时候,如果不setStartTime/setFinishedTime,会报错,MySQL版本是 mysql Ver 8.0.30 for Linux on x86_64 (MySQL Community Server - GPL)

,应该跟MySQL的模式有关,建议在代码里赋值

Mengqi777 avatar Sep 21 '22 11:09 Mengqi777