【发布时间】:2019-05-01 12:04:58
【问题描述】:
我正在尝试在 MySQL 中使用模式时间戳,由于我的表大小为 2.6 GB,因此行数有限。
这是我正在使用的连接器属性:
{
"name": "jdbc_source_mysql_registration_query",
"config": {
"connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector",
"key.converter": "io.confluent.connect.avro.AvroConverter",
"key.converter.schema.registry.url": "http://localhost:8081",
"value.converter": "io.confluent.connect.avro.AvroConverter",
"value.converter.schema.registry.url": "http://localhost:8081",
"connection.url": "jdbc:mysql://localhost:3310/users?zeroDateTimeBehavior=ROUND&useCursorFetch=true&defaultFetchSize=1000&user=kotesh&password=kotesh",
"query": "SELECT matriid,DateUpdated from users.employee WHERE date(DateUpdated)>='2018-11-28' ",
"mode": "timestamp",
"timestamp.column.name": "DateUpdated",
"validate.non.null": "false",
"topic.prefix": "mysql-prod-kot-"
}
}
我得到如下:
INFO TimestampIncrementingTableQuerier{table=null, query='SELECT matriid,DateUpdated from users.employee WHERE date(DateUpdated)>='2018-11-28'', topicPrefix='mysql-prod-kot-', incrementingColumn='', timestampColumns=[DateUpdated]} 准备好的 SQL 查询:SELECT matriid,DateUpdated from users.employee WHERE 日期(更新日期)>='2018-11-28'
DateUpdated> ?和DateUpdatedDateUpdated ASC (io.confluent.connect.jdbc.source.TimestampIncrementingTableQuerier:161) [2018-11-29 17:29:00,981] 错误无法对表 TimestampIncrementingTableQuerier{table=null, query='SELECT 运行查询 matriid,DateUpdated from users.employee WHERE date(DateUpdated)>='2018-11-28'', topicPrefix='mysql-prod-kot-', incrementingColumn='',timestampColumns=[DateUpdated]}:{} (io.confluent.connect.jdbc.source.JdbcSourceTask:328) java.sql.SQLSyntaxErrorException:您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册 在 'WHEREDateUpdated> '1970-01-01 附近使用正确的语法 00:00:00.0' ANDDateUpdated
【问题讨论】:
标签: jdbc apache-kafka apache-kafka-connect confluent-platform confluent-schema-registry