Setting up Confluent connector for Kafka — HDFS
Vikram Aroskar
114

Vikram Aroskar

Please find my source mysql-jdbc connections:

{
 “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-”
 }
}

I am getting error as below:

INFO TimestampIncrementingTableQuerier{table=null, query=’SELECT matriid,DateUpdated from users.employee WHERE date(DateUpdated)>=’2018–11–28'’, topicPrefix=’mysql-prod-kot-’, incrementingColumn=’’, timestampColumns=[DateUpdated]} prepared SQL query: SELECT matriid,DateUpdated from users.employee WHERE date(DateUpdated)>=’2018–11–28' WHERE `DateUpdated` > ? AND `DateUpdated` < ? ORDER BY `DateUpdated` ASC (io.confluent.connect.jdbc.source.TimestampIncrementingTableQuerier:161)
[2018–11–29 17:29:00,981] ERROR Failed to run query for table 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: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘WHERE `DateUpdated` > ‘1970–01–01 00:00:00.0’ AND `DateUpdated` < ‘2018–11–29 17’ at line 1