IBMStreams / streamsx.json

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

Create parameters of type attribute for input attributes currently specified by name. #33

Closed hildrum closed 9 years ago

hildrum commented 9 years ago

Currently, the optional jsonStringAttribute for JSONToTuple is an attribute of type rstring. At run time, the operator determines whether the given string corresponds to a valid input attribute. But with 4.0, we can have parameters to java that are type Attribute, so I propose adding one. We can't have the new parameter be the same name as the current one. Possible names:

The TupleToJSON operator's rootAttribute parameter is similar. It is used to optionally specify the attribute to be converted to a JSON string. (By default, it converts the whole tuple.) Possible names:

ddebrunner commented 9 years ago

I would suggest using the existing names and just dropping the "Attribute", which leaves:

JSONToTuple : jsonString, jsonStringOutput, target

TupleToJSON: jsonString and root

hildrum commented 9 years ago

While jsonString for JSONToTuple's input is a good name, I don't think root is very descriptive for the TupleToJSON input. Since I have to make a new parameter name anyway, I want a better name. Perhaps jsonData? The only plus with root I can see is that it's clearly related to rootAttribute.

I'm not making new parameters for jsonStringOutputAttribute,targetAttribute, or TupleToJSON's jsonStringAttribute since all of those are attributes on the output port and so can't be represented internally by TupleAttribute.

hildrum commented 9 years ago

Changed JSONToTuple's input parameter to be jsonString, and currently using jsonData for TupleToJSON input specifier parameter.
Unless there is further discussion, I'll pull it in tomorrow.