数字字段格式

k5hmc34c  于 2021-06-04  发布在  Kafka
关注(0)|答案(0)|浏览(303)

我们正在通过oggbigdata19.1kafka连接处理程序将oracle表复制到kafka。Kafka版本是0.10.1。复制工作正常,但我们观察到json负载中的数据表示有问题,如下所示-

{"table":"XXX","op_type":"I","op_ts":"2020-09-28 18:09:40.000729","current_ts":"2020-09-28 19:43:04.090000","pos":"00000000000000013964","ID":5.9765349E7,"TRADE_DISCOUNT_ID":1719898.0,"SKU":"461434697002","OPTION_CODE":"461434697_BEIGE","MRP":2999.0,"LIST_PRICE":1499.5,"CHANNEL":"ALL","PRIORITY":0,"DISCOUNT_TYPE":"percentage","DISCOUNT_VALUE":50.0,"WAS_PRICE":2999.0,"START_DATE":"2020-09-28 18:24:28.000000000","END_DATE":"2030-12-31 11:45:00.000000000","STATUS":"approved","SUSPENSION_DATE":null,"CREATED_DATE":"2020-09-28 18:09:40.618000000","UPDATED_DATE":"2020-09-28 18:09:40.618000000","JSON":null}

如果您注意到,列id用指数表示,列trade\u discount\u id用小数点后有0的小数点表示。

"ID":5.9765349E7,"TRADE_DISCOUNT_ID":1719898.0

源表结构如下-

CREATE TABLE XXX
   (    "ID" NUMBER(19,0) NOT NULL ENABLE,
        "TRADE_DISCOUNT_ID" NUMBER(19,0) NOT NULL ENABLE,
        "SKU" VARCHAR2(20) NOT NULL ENABLE,
        "OPTION_CODE" VARCHAR2(255) NOT NULL ENABLE,
        "MRP" NUMBER(10,2) NOT NULL ENABLE,
        "LIST_PRICE" NUMBER(10,2),
        "CHANNEL" VARCHAR2(20) NOT NULL ENABLE,
        "PRIORITY" NUMBER(10,0) NOT NULL ENABLE,
        "DISCOUNT_TYPE" VARCHAR2(20) NOT NULL ENABLE,
        "DISCOUNT_VALUE" NUMBER(10,2) NOT NULL ENABLE,
        "WAS_PRICE" NUMBER(10,2) NOT NULL ENABLE,
        "START_DATE" TIMESTAMP (6) NOT NULL ENABLE,
        "END_DATE" TIMESTAMP (6) NOT NULL ENABLE,
        "STATUS" VARCHAR2(20),
        "SUSPENSION_DATE" TIMESTAMP (6),
        "CREATED_DATE" TIMESTAMP (6),
        "UPDATED_DATE" TIMESTAMP (6),
        "JSON" CLOB,
         PRIMARY KEY ("ID")

我们正在使用甲骨文金门Kafka连接处理程序。同样适用于甲骨文金门Kafka处理器。
Kafka制作人使用的是-

bootstrap.servers=xx.xx.xx.xx:6667
acks=1

# JSON Converter Settings

key.converter=org.apache.kafka.connect.json.JsonConverter
key.converter.schemas.enable=false
value.converter=org.apache.kafka.connect.json.JsonConverter
value.converter.schemas.enable=false
converter.type=key
converter.type=value
converter.type=header

# Adjust for performance

buffer.memory=33554432
batch.size=16384
linger.ms=2000
reconnect.backoff.ms=1000

security.protocol=SASL_PLAINTEXT

sasl.kerberos.service.name=kafka
sasl.mechanism=GSSAPI

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题