Nifi PutSQL 时间戳/日期时间错误无法转换错误

Nifi PutSQL Timestamp/Datetime error cannot be converted error(Nifi PutSQL 时间戳/日期时间错误无法转换错误)
本文介绍了Nifi PutSQL 时间戳/日期时间错误无法转换错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我尝试了建议使用UpdateAttribute"处理器来消除时间戳格式转换错误的解决方案,即ConvertJSONtoSQL-> UpdateAttribute--> PutSQL

I tried the solution suggested to remove the timestamp format conversion error by using "UpdateAttribute" processor i.e. ConvertJSONtoSQL-> UpdateAttribute--> PutSQL

在 UpdateAttribute 中我使用了

In UpdateAttribute I used

Property               Value
---------------        ------------------------
sql.args.4.value ->    ${sql.args.4.original:format("yyyy-MM-dd HH:mm:ss")}

日志:

sql.args.4.value的值为'',无法转换为时间戳在org.apache.nifi.processors.standard.PutSQL.setParameters(PutSQL.java:690)在

The value of the sql.args.4.value is '', which cannot be converted to a timestamp at org.apache.nifi.processors.standard.PutSQL.setParameters(PutSQL.java:690) at

在不使用 UpdateAttribute 的情况下,我还尝试了直接 ConvertJSONtoSQL-> PutSQL .日志在引用 'Aug 14 2017 10:17:00 EDT' 中显示了与 datetime 值相同的错误,即当我们使用 UpdateAttribute 时,它只是删除该值并放置空引号,但错误未解决.

Without the use of UpdateAttribute I also tried direct ConvertJSONtoSQL-> PutSQL . Log showed the same error with datetime value in quote 'Aug 14 2017 10:17:00 EDT' i.e. when we use UpdateAttribute, it just removes the value and put empty quotes but the error is not resolved.

注意: MySQL 表具有这些列的日期时间数据类型,不确定为什么尝试转换为时间戳会出错.我还在本地主机上的源表和目标表中尝试了 Timestamp 数据类型,但不走运!

Note: MySQL table has datetime datatype for those columns not sure why it errors out by trying to convert to TimeStamp. I also tried Timestamp datatype in source and target table on localhost, no luck!

推荐答案

我找到了问题的答案

sql.args.n.value ->${sql.args.n.value:format("yyyy-MM-dd HH:mm:ss.SSS")}.

这篇关于Nifi PutSQL 时间戳/日期时间错误无法转换错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

ibtmp1是非压缩的innodb临时表的独立表空间,通过innodb_temp_data_file_path参数指定文件的路径,文件名和大小,默认配置为ibtmp1:12M:autoextend,也就是说在文件系统磁盘足够的情况下,这个文件大小是可以无限增长的。 为了避免ibtmp1文件无止境的暴涨导致
What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)
MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)
Why Mysql#39;s Group By and Oracle#39;s Group by behaviours are different(为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同)
MySQL GROUP BY DateTime +/- 3 seconds(MySQL GROUP BY DateTime +/- 3 秒)