admin管理员组文章数量:1391998
I have Debezium 3.0.8. I setup source SQL connector, which produce data from CDC SQL Server (MSSQL). Trying to setup io.debezium.connector.jdbc.JdbcSinkConnector
for a table with varbinary field
Source connector successfully produces messages to topic and schema-registry. Message like
{
"after": {
"Value": {
"Field0": "ÞÊ0T",
"Field1": 4
}
},
.....
Schema for value is:
{
"type": "record",
"name": "Envelope",
"namespace": "test.Domino.dbo._del_test_kafka25_2",
"fields": [
{
"name": "before",
"type": [
"null",
{
"type": "record",
"name": "Value",
"fields": [
{
"name": "Field0",
"type": "bytes"
},
{
"name": "Field1",
"type": "int"
}
],
"connect.name": "test.Domino.dbo._del_test_kafka25_2.Value"
}
],
So this part looks ok for me. When I try run io.debezium.connector.jdbc.JdbcSinkConnector
it fails with :
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The conversion from UNKNOWN to VARBINARY is unsupported
I turned on TRACE logging and got this:
Bind field 'Field0' at position 2 with type io.debezium.connector.jdbc.type.connect.ConnectBytesType: java.nio.HeapByteBuffer[pos=0 lim=5 cap=5]
I looked over the source of debezium and also jdbc source and I think that the root cause is that somewhy value of debezium type BYTES
was created as java.nio.HeapByteBuffer
instead of byte[]
which is expected by microsoft jdbc driver.
Can anybody help with the solution for this?
After digging into source code i think
I have Debezium 3.0.8. I setup source SQL connector, which produce data from CDC SQL Server (MSSQL). Trying to setup io.debezium.connector.jdbc.JdbcSinkConnector
for a table with varbinary field
Source connector successfully produces messages to topic and schema-registry. Message like
{
"after": {
"Value": {
"Field0": "ÞÊ0T",
"Field1": 4
}
},
.....
Schema for value is:
{
"type": "record",
"name": "Envelope",
"namespace": "test.Domino.dbo._del_test_kafka25_2",
"fields": [
{
"name": "before",
"type": [
"null",
{
"type": "record",
"name": "Value",
"fields": [
{
"name": "Field0",
"type": "bytes"
},
{
"name": "Field1",
"type": "int"
}
],
"connect.name": "test.Domino.dbo._del_test_kafka25_2.Value"
}
],
So this part looks ok for me. When I try run io.debezium.connector.jdbc.JdbcSinkConnector
it fails with :
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The conversion from UNKNOWN to VARBINARY is unsupported
I turned on TRACE logging and got this:
Bind field 'Field0' at position 2 with type io.debezium.connector.jdbc.type.connect.ConnectBytesType: java.nio.HeapByteBuffer[pos=0 lim=5 cap=5]
I looked over the source of debezium and also jdbc source and I think that the root cause is that somewhy value of debezium type BYTES
was created as java.nio.HeapByteBuffer
instead of byte[]
which is expected by microsoft jdbc driver.
Can anybody help with the solution for this?
After digging into source code i think
Share Improve this question asked Mar 14 at 9:50 Yuriy VikulovYuriy Vikulov 2,5095 gold badges26 silver badges32 bronze badges1 Answer
Reset to default 1So the problem was that there were no correct handling from BYTES type to VARBINARY SQL Server type in JDBC Sink connector. Made a PR to fix this issue: https://github/debezium/debezium/pull/6235
Some time ago same issue was for Postgres: https://github/debezium/debezium-connector-jdbc/pull/36
本文标签: apache kafkaDebezium JDBC sink Connector and MSSQL varbinaryStack Overflow
版权声明:本文标题:apache kafka - Debezium JDBC sink Connector and MSSQL varbinary - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744662984a2618359.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论