Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Change the timestamp with QueryRecord

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

1 REPLY 1
Highlighted

Re: Change the timestamp with QueryRecord

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.

Don't have an account?
Coming from Hortonworks? Activate your account here