3

I'm new to apache NiFi, I have converted the Date type data into timestamp in Query Record Processor by using following query

select ${fn Convert(<ColumnName>,<Datatype as 'timestamp'>) as ColumnName from flowfile}

But I am facing issue when tried with below query to convert timestamp to datetime

select {fn CONVERT(CAST(CurrentDate as BIGINT),date)} as CurrentDate from flowfile

Error Details:

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

How can be converted the timestamp value into a DateTime using Query Record Processor?

Óscar Andreu
  • 1,630
  • 13
  • 32
Kumar
  • 177
  • 1
  • 9

1 Answers1

0

Not sure if this solves it, but what stands out is that the first expression starts with a dollar sign while the second does not.

Dennis Jaheruddin
  • 21,208
  • 8
  • 66
  • 122