Kafka jdbc接收器连接器无法正确转换时间戳

时间:2018-05-03 06:38:55

标签: apache-kafka avro apache-kafka-connect

我有一个架构

  {
      "type" : "record",
      "name" : "test",
      "namespace" : "test",
      "fields" : [ {
        "name" : "time",
        "type": [ "null", {
          "type": "long",
          "logicalType": "timestamp-millis"
        }]
      }, 
....
 {
        "name" : "time2",
        "type": ["null", {
          "type" :  "long",
          "logicaltype": "timestamp-millis"
        }]
      }
    }

但是当kafka连接器反序列化数据并创建sql插件时我有下一个错误

column "time2" is of type timestamp without time zone but expression is of type bigint

插入:

INSERT INTO "test" ("time",  "time2")
VALUES  ('2018-2-2 20:14:45.507000 +0:0:0', 1517602485507)

这很奇怪,因为日期和代码是一样的。为什么第一个日期字段“时间”转换为好,但在第二个我有问题?

0 个答案:

没有答案