我有一个模式
{
"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)
很奇怪,因为日期和代码是一样的。为什么第一个日期字段“time”转换为ok,而第二个日期字段我有问题?
暂无答案!
目前还没有任何答案,快来回答吧!