我是 apache NiFi 的新手,我已经使用以下查询将日期类型数据转换为查询记录处理器中的时间戳
select ${fn Convert(<ColumnName>,<Datatype as 'timestamp'>) as ColumnName from flowfile}
但是我在尝试使用以下查询将时间戳转换为日期时间时遇到问题
select {fn CONVERT(CAST(CurrentDate as BIGINT),date)} as CurrentDate from flowfile
错误详情:
QueryRecord[id=0e0d33b4-0165-1000-9db1-e7d0dad2240d] Unable to query StandardFlowFileRecord[uuid=b04e508b-675e-444b-8a87-d77b77b802cd,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1533555234293-23, container=default, section=23], offset=3200, length=134],offset=0,name=AdventureWorks.csv,size=134] due to null: java.lang.NullPointerException
如何使用查询记录处理器将时间戳值转换为日期时间?
最佳答案
不确定这是否解决了问题,但值得注意的是第一个表达式以美元符号开头,而第二个则不是。
关于sql - 如何在查询记录处理器中转换 DateTime,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51719151/