How to use multiple values for tables.whitelist in kafka-connect-jdbc

1,202 views
Skip to first unread message

Basti

unread,
Jun 13, 2017, 12:50:53 PM6/13/17
to Confluent Platform
Hey,

I tried for the first time to use multiple values in table.whitelist. I submitted the following connector json config running version 3.2.1

{
 
"name":"jdbc-updatedat",
 
"config": {
 
"tasks.max":5,
 
"connector.class":"io.confluent.connect.jdbc.JdbcSourceConnector",
 
"connection.url":"jdbc:mysql://10.10.1.90:3306/test?user=test&password=test",
 
"mode":"timestamp+incrementing",
 
"incrementing.column.name":"id",
 
"timestamp.column.name":"updatedAt",
 
"table.whitelist": ["User","Address","Email"]
 
}
}

However that results in the following exception and a 500 HTTP response

Can not deserialize instance of java.lang.String out of START_ARRAY token
 at
[Source: org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream@7e77e40; line: 9, column: 39] (through reference chain: org.apache.kafka.connect.runtime.rest.entities.CreateConnectorRequest["config"]->java.util.LinkedHashMap["table.whitelist"])

thanks a lot in advance :)


Gwen Shapira

unread,
Jun 13, 2017, 1:11:42 PM6/13/17
to Confluent Platform
I think it is just a comma separated string. Something like:

"table.whitelist": "UserAddressEmail"

--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/f42a86ae-3432-4536-8338-8121572d55f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rohit Chowdhary

unread,
Aug 19, 2018, 8:57:46 PM8/19/18
to Confluent Platform
How do i specify different column names for different tables in the whitelist? Something like this for the table example Gwen provided above: 
"timestamp.column.name":"userid, addressid, emailid",
Is it possible or supported?

Thanks


On Tuesday, June 13, 2017 at 1:11:42 PM UTC-4, Gwen Shapira wrote:
I think it is just a comma separated string. Something like:

"table.whitelist": "UserAddressEmail"

On Tue, Jun 13, 2017 at 9:50 AM Basti <ba...@applike.info> wrote:
Hey,

I tried for the first time to use multiple values in table.whitelist. I submitted the following connector json config running version 3.2.1

{
 
"name":"jdbc-updatedat",
 
"config": {
 
"tasks.max":5,
 
"connector.class":"io.confluent.connect.jdbc.JdbcSourceConnector",
 
"connection.url":"jdbc:mysql://10.10.1.90:3306/test?user=test&password=test",
 
"mode":"timestamp+incrementing",
 
"incrementing.column.name":"id",
 
"timestamp.column.name":"updatedAt",
 
"table.whitelist": ["User","Address","Email"]
 
}
}

However that results in the following exception and a 500 HTTP response

Can not deserialize instance of java.lang.String out of START_ARRAY token
 at
[Source: org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream@7e77e40; line: 9, column: 39] (through reference chain: org.apache.kafka.connect.runtime.rest.entities.CreateConnectorRequest["config"]->java.util.LinkedHashMap["table.whitelist"])

thanks a lot in advance :)


--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.

Gwen Shapira

unread,
Aug 19, 2018, 11:04:31 PM8/19/18
to Confluent Platform
unfortunately, no :(

If you feel like coding, it should be relatively straight forward to add this feature.

Otherwise, you are stuck with either multiple connectors, or database views that make sure you always use the same column...

To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Gwen Shapira
Product Manager | Confluent
650.450.2760 @gwenshap
Follow us: Twitter | blog

Reply all
Reply to author
Forward
0 new messages