我正在部署Kafka Connect JDBC源。它与dabase正确连接,但是我得到的结果是:
{
"schema": {
"type": "struct",
"fields": [
{
"type": "bytes",
"optional": false,
"name": "org.apache.kafka.connect.data.Decimal",
"version": 1,
"parameters": {
"scale": "0"
},
"field": "ID"
},
{
"type": "bytes",
"optional": false,
"name": "org.apache.kafka.connect.data.Decimal",
"version": 1,
"parameters": {
"scale": "0"
},
"field": "TENANT_ID"
},
{
"type": "bytes",
"optional": false,
"name": "org.apache.kafka.connect.data.Decimal",
"version": 1,
"parameters": {
"scale": "0"
},
"field": "IS_ACTIVE"
},
{
"type": "int64",
"optional": false,
"name": "org.apache.kafka.connect.data.Timestamp",
"version": 1,
"field": "CREATION_DATE"
},
{
"type": "int64",
"optional": true,
"name": "org.apache.kafka.connect.data.Timestamp",
"version": 1,
"field": "LAST_LOGIN"
},
{
"type": "string",
"optional": true,
"field": "NAME"
},
{
"type": "string",
"optional": true,
"field": "MOBILEPHONE"
},
{
"type": "string",
"optional": true,
"field": "EMAIL"
},
{
"type": "string",
"optional": true,
"field": "USERNAME"
},
{
"type": "string",
"optional": true,
"field": "PASSWORD"
},
{
"type": "string",
"optional": true,
"field": "EXTERNAL_ID"
}
],
"optional": false
},
"payload": {
"ID": "fdo=",
"TENANT_ID": "Uw==",
"IS_ACTIVE": "AQ==",
"CREATION_DATE": 1548987456000,
"LAST_LOGIN": 1557401837030,
"NAME": " ",
"MOBILEPHONE": " ",
"EMAIL": " ",
"USERNAME": "ES00613751",
"PASSWORD": " ",
"EXTERNAL_ID": " "
}
}
您可以看到,数字和时间戳值未正确显示值。
配置:
name=jdbc-teradata-source-connector
connector.class=io.confluent.connect.jdbc.JdbcSourceConnector
tasks.max=1
connection.url=...
numeric.maping=best_fit
topic.prefix=test-2
mode=timestamp+incrementing
timestamp.column.name=LAST_LOGIN
incrementing.column.name=ID
topic=test-jdbc-oracle-source
数字映射不起作用,因为它是汇合3.2.2我还试图将数字投入数字,但也不起作用。
添加连接器config numeric.mapping
"numeric.mapping":"best_fit"
您可以在此处查看所有解释