IBMStreams / streamsx.json

Toolkit for working with JSON in SPL applications.
http://ibmstreams.github.io/streamsx.json/
Other
3 stars 19 forks source link

JSONToTuple does not copy input attributes to output tuple #36

Closed ddebrunner closed 8 years ago

ddebrunner commented 8 years ago

JSONToTuple says: Atributes from the input stream that match those in the output stream will be automaticall copied over. However, if they also exist in the JSON input, their assigned value will be of that specified in the JSON.

However this does not appear to work, input attributes that are not in the JSON value are set to the default value. While the code at line 174 does the auto assignment from input to output, I think it is being overriden again at line 192: https://github.com/IBMStreams/streamsx.json/blob/master/com.ibm.streamsx.json/impl/java/src/com/ibm/streamsx/json/JSONToTuple.java#L192

In this case I have two output attributes that need to be set from the JSON (d, ts) and a number of input attributes (deviceId, deviceType) that need to be copied from input to output.