Skip to main content
Tokolosk
Gold ⭐️
July 19, 2021
Question

PutDatabaseRecord or JsonTreeReader changing time zones?

I live in a GMT +2 timezone but we collect all our data as GMT.

 

My PutDatabaseRecord processor receives JSON with one field being the timestamp, e.g.:

 

2021-07-19 14:52:39

 

If I look at the flowfile just before the PutDatabaseRecord processor this timestamp is correct. However it gets inserted into the database as 2021-07-19 16:52:39

 

I can't find any documentation on how to prevent this in 1.14.0.

 

Any idea what to do? Currently I'm subtracting an additional 2 hours to make up for this but that's not a good permanent fix.

 

Edit:

Is this perhaps related to this issue?  @mburgess  : if not and this is a bug then I can give more info.

https://issues.apache.org/jira/browse/NIFI-8768?jql=text%20~%20%22time%20zone%20JsonTreeReader%22

 

Edit 2: this worked previously in 1.12.2

8 replies

GabrielNifi
Gold ⭐️
July 19, 2021

Do not use string. "Use Avro Logical Types: TRUE". So, try converting to Avro before PutDatabaseRecord.

Translate
Tokolosk
TokoloskAuthor
Gold ⭐️
July 21, 2021

Is there any way to reach the Devs to know if this is intentional or not?

 

I need to upgrade a bunch of servers from 1.12.2 to 1.14.0, but I also need to know if we first have to add a bunch of processors to deal with this timezone change from PutDatabaseRecord.

Translate
DennisJaheruddi
Platinum ⭐️
Platinum ⭐️
July 22, 2021

I have seen a similar issue a while ago but that one got fixed, the best way to reach the experts to check if there is a known fix is to go to the Cloudera Support Portal, once you log in you should be able to log a support ticket.

Translate
- Dennis Jaheruddin If this answer helped, please mark it as 'solved' and/or if it is valuable for future readers please apply 'kudos'.
Tokolosk
TokoloskAuthor
Gold ⭐️
July 30, 2021

Hi @DennisJaheruddi 

 

Unfortunately seems I cannot access the support ticket area - not enough privileges.

 

All I need to know if this is a bug (in which case I stay with 1.12.1) or if this is a new "feature" in which case I need to update all my flows when upgrading to 1.14.0.

 

 

Translate