IBMStreams / streamsx.json

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

why there are 2 parameters (inputAttribute and rootAttribute) in TupleToJSON operator for specifying input stream attribute #57

Closed conglisc closed 8 years ago

conglisc commented 8 years ago

inputAttribute takes an attribute in the input stream whereas rootAttribute accepts a attribute name, but they are all used for indicating the attribute in input stream as the root of JSON object. These 2 attributes are essentially doing the same thing.

My question is why do we need to expose 2 parameters, which are doing same job, in TupleToJSON operator.

ddebrunner commented 8 years ago

Due to timing, initially Java operators did not support attribute parameters, so attribute names were used.

Using the attribute is better as it will be checked at SPL compile time, so a attribute parameter was added.

Typically they have closely related names, but there probably needs to be SPLDOC that indicates the name version is deprecated and the other one should be used.

conglisc commented 8 years ago

Thanks Dan, it will need SPLDOC to indicate this.