正在加载连接器:
{
"name": "jdbc-source-test",
"config": {
"connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector",
"connection.url": "jdbc:mysql://localhost:3306/test?user=root&password=password",
"table.whitelist":"test",
"mode": "timestamp",
"timestamp.column.name":"create_time",
"topic.prefix": "test-mysql-jdbc-",
"name":"jdbc-source-test"
}
}将下一条消息记录到日志中:
[2018-12-12 17:33:14,225] ERROR WorkerSourceTask{id=jdbc-source-test-0} Task threw an uncaught and unrecoverable exception (org.apache.kafka.connect.runtime.WorkerTask:177)
org.apache.kafka.connect.errors.ConnectException: Cannot make incremental queries using timestamp columns [create_time] on `test`.`test` because all of these columns nullable.我建议它不起作用,因为这个列的类型是bigint(20)。有什么解决方法吗?合流版本- 5.0.1。
发布于 2020-09-22 05:32:19
我在Postgresql上遇到了同样的错误,在数据库中设置错误NOT NULL中提到的时间戳列解决了这个问题。
另一种选择是在连接器配置中使用validate.non.null:false。
validate.non.null:缺省情况下,JDBC连接器将验证所有增量表和时间戳表是否没有为用作其ID/时间戳的列设置空值。
如果表不这样做,JDBC连接器将无法启动。将其设置为false将禁用这些检查。
发布于 2022-01-27 07:03:27
解决此问题的简单方法是在配置文件中添加"validate.non.null":“false
{
"name": "jdbc-source-test",
"config": {
"connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector",
"connection.url": "jdbc:mysql://localhost:3306/test?user=root&password=password",
"table.whitelist":"test",
"mode": "timestamp",
"timestamp.column.name":"create_time",
"topic.prefix": "test-mysql-jdbc-",
"validate.non.null": "false"
}
}https://stackoverflow.com/questions/53745747
复制相似问题