Skip to content

JSONToTuple Operator

Rohit Wagle edited this page Apr 25, 2014 · 13 revisions

#JSONToTuple operator

The JSONToTuple operator can be used to convert JSON strings to SPL tuples. The operator inspects the schema of the output stream and converts all matching attributes of the JSON to their SPL counterparts.

##Namespace

com.ibm.streamsx.json

##Parameters Following parameters are supported

jsonStringAttribute
This is an optional parameter that can be used to specify the name of the input stream attribute that contains the JSON string. By default, the operator expects an attribute named "jsonString" to be present in the input stream. This attribute can be either of USTRING or RSTRING type.

jsonStringOutputAttribute This is an optional parameter that can be used to copy the original JSON string to the output stream. It should contain the name of the output stream attribute, of type USTRING or RSTRING. By default, the input JSON string will not be copied to the output stream.

targetAttribute This is an optional parameter that can be used to specify the name of an inner attribute of the output stream to be the root of the SPL typle to be populated. The specified attribute can only be of TUPLE type. By default, the base of the output stream tuple is used to match with the JSON.

Clone this wiki locally