Support Questions
Find answers, ask questions, and share your expertise

Change the timestamp with QueryRecord

New Contributor

Hi - 


in my flow-file records have a timestamp ({"type": "long", "logicalType": "timestamp-millis"}). I want to change this timestamp. 


I tried to use the following QueryRecord for this

SELECT (productionDate - 1000) as startTs FROM FLOWFILE


But I get a "java.sql.SQLException: Error while preparing statement " exception. 


Is this even possible with QueryRecord? 
What is the best alternative otherwise?


Thank you!


BR Lomu


New Contributor

Note: As a work-around you can avoid changing the field type to logicalType milliseconds at just leave it with long. 


With a long you can use sql-logic to subtract from the timestamps.

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.