Perform Mathematical operations on JSON File

We have a JSON file as an input to a processor.

{"x" : 18, "y" : 3}
Can we do mathematical operations on these values instead of writing a custom processor?
we need to do mathematical operations like.

( x / y ) * 3

and save the result to an output file.

text in generateFlowFile processor:

x|y
1|123
2|111

And this is or AVRO schema:
{
"name": "myfirstschema",
"namespace": "nifi",
"type": "record",
"fields": [
{"name": "a" , "type": "int"},
{"name": "b" , "type": "int"} ]
}

when we change the above types to string, it works fine but can not perform math operations on a string.
we selected 'Use Schema Name Property' in Schema Access Strategy. Please help.

Tagged:
Sign In or Register to comment.