尝试通过使用 "UpdateAttribute" 处理器解决时间戳格式转换错误,即 ConvertJSONtoSQL-> UpdateAttribute--> PutSQL

Trying To Solve remove the timestamp format conversion error by using "UpdateAttribute" processor i.e. ConvertJSONtoSQL-> UpdateAttribute--> PutSQL

From This Answer

Same issue but no luck in my case i'm using ConvertJsonToSql---->(Relationship--SQL,Original)---->Update Attribute(Poperty from your answer)------>PutSql. java.sql.SQLDataException :The value of the sql.args.28.value is Mon Oct 09 23:55:23 which cannot be converted to a timestamp.

  1. 在数据库中,日期以 mysql 日期时间格式存储 2017-09-11 14:26:13。
  2. 来自 Capture Change Mysql 的 NiFi 流文件显示为 Mon Sep 11 19:56:13 IST 2017。
  3. JoltTransform Json 也相同,并且在将形式 json 转换为 sql 时 sql.args 的流文件属性值是 93 和 sql.args.27.value 是 10 月 9 日星期一 23:38:55.

欢迎和赞赏任何建议。

我得到了答案 在更新属性处理器 属性 中:sql.args.27.value 和值:${sql.args.27.value:toDate("EEE MMM dd HH:mm:ss z yyyy"):toNumber():格式("yyyy-MM-dd HH:mm:ss.SSS")}