Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 01-30-2017 05:36 PM
Hi All,
I am doing an attribute to json conversion using NiFi AttributesToJSON Processor. What is observed is that any key value pair is mapped to String datatype in the resultant JSON, which I believe is the intended behavior.
However, is there any known approaches to specify the datatype for a Key-Value pair? Currently I am employing an ExecuteScript processor once the JSON conversion is done to convert the "String" data type to whatever datatype I want the key-value to be in.
Are there other better approaches?
Created 01-30-2017 06:20 PM
There is a JIRA to improve AttributesToJson to support types besides strings:
https://issues.apache.org/jira/browse/NIFI-2359
Currently all flow file attributes are stored as strings so there needs to be a way for the user to indicate the type for each attribute. For example, if attribute "foo" has a value of "true" we don't really know if the user wants true as a boolean or true as a string.
A convention could be created where each attribute could have a corresponding type attribute so something like:
attr1 = true
attr1.type = boolean
attr2 = true
attr2.type = string
Created 01-30-2017 06:20 PM
There is a JIRA to improve AttributesToJson to support types besides strings:
https://issues.apache.org/jira/browse/NIFI-2359
Currently all flow file attributes are stored as strings so there needs to be a way for the user to indicate the type for each attribute. For example, if attribute "foo" has a value of "true" we don't really know if the user wants true as a boolean or true as a string.
A convention could be created where each attribute could have a corresponding type attribute so something like:
attr1 = true
attr1.type = boolean
attr2 = true
attr2.type = string
Created 01-30-2017 06:35 PM
@Bryan Bende : Thanks for pointing the Jira.