Flink_jdbc_connector:Duplicate entry '1' for key 'PRIMARY' #1049
Yougetadad
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
使用jdbc链接mysql,定义了主键,id有重复,写入就报错了,看资料说,jdbc定义主键后应该是upsert模式,为啥会出现如下报错啊:
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '1' for key 'PRIMARY'
CREATE TABLE test_sink (
id varchar PRIMARY KEY NOT ENFORCED,
name varchar,
class varchar
) WITH (
'connector.type' = 'jdbc',
'connector.url' = 'jdbc:mysql:///database',
'connector.table' = 'kafka_test',
'connector.username' = 'root',
'connector.password' = '***********',
'connector.write.flush.max-rows' = '1'
);
Beta Was this translation helpful? Give feedback.
All reactions