Skip to main content
AndreyN
Bronze ⭐️⭐️⭐️
January 26, 2023
Question

Turn off json values rounding in NiFi

Hello,

 

I have NiFi flow with EvaluateJsonPath that read a content of FlowFile with json to Data attribute. But numeric values of json are changed, i.e.:

GenerateFlowFile
{
"Amount1": 999999999999999999.99,
"Amount2": 999999999.99
}

->
EvaluateJsonPath
Data $
->
Data
{"Amount1":1.0E18,"Amount2":9.9999999999E8}

How do I stop NiFi from rounding off and changing json numbers? Tested on NiFi 1.15/1.19.

Thanks.

1 reply

joseomjr
Gold ⭐️⭐️
December 8, 2023

I don't see EvaluateJsonPath give options so it might be something you'd have to handle on your own...personally I'd do it via a Groovy scripted processor for greater control and performance.

Translate