[英]ERROR: column "DOJ" is of type timestamp without time zone but expression is of type character varying
I'm trying to extract data from oracle db table and insert into postgres db table using nifi我正在尝试从 oracle 数据库表中提取数据并使用 nifi 插入到 postgres 数据库表中
I'm using ExecuteSQLRecord with JsonRecordSetWriter and I'm giving this json data to PutDataBaseRecord with record reader as JsonTreeReader.我将 ExecuteSQLRecord 与 JsonRecordSetWriter 一起使用,并将此 json 数据提供给 PutDataBaseRecord,记录读取器为 JsonTreeReader。
My data in queue is like:-我在队列中的数据如下:-
[ {
"EMP_ID" : "1",
"DOJ" : "631170000000"
}, {
"EMP_ID" : "2",
"DOJ" : "631170000000"
}]
As per usage guide根据使用指南
Any numeric value can be coerced into a Date, Time, or Timestamp type, by assuming that the Long value is the number of milliseconds since epoch (Midnight GMT, January 1, 1970).通过假设 Long 值是自纪元(格林威治标准时间午夜,1970 年 1 月 1 日)以来的毫秒数,可以将任何数值强制转换为日期、时间或时间戳类型。 A String value can be coerced into a Date, Time, or Timestamp type, if its format matches the configured "Date Format," "Time Format," or "Timestamp Format."如果字符串值的格式与配置的“日期格式”、“时间格式”或“时间戳格式”匹配,则可以将字符串值强制转换为日期、时间或时间戳类型。
But in my case, date is extracting into milliseconds as a String.但在我的情况下,日期作为字符串提取到毫秒。
Is I'm missing any configuration with respect to JsonRecordSetWriter and JsonTreeReader regarding date/timestamp field.我是否缺少有关日期/时间戳字段的 JsonRecordSetWriter 和 JsonTreeReader 的任何配置。
I have seen options in JsonRecordSetWriter to provide date, time or timestamp format.我在 JsonRecordSetWriter 中看到了提供日期、时间或时间戳格式的选项。 In my oracle database date field has data like:- 2001-12-01 00:00:00 but how can I provide this value in date attribute of JsonRecordSetWriter, as it is expecting date format same as Java Date format.在我的 oracle 数据库日期字段中具有如下数据:- 2001-12-01 00:00:00但我如何在 JsonRecordSetWriter 的日期属性中提供此值,因为它期望日期格式与 Java 日期格式相同。
How do I overcome my issue, How do I extract data in timezone format from oracle date field or milliseconds but as numeric...如何克服我的问题,如何从 oracle 日期字段或毫秒中提取时区格式的数据,但作为数字...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.