IBMStreams / streamsx.json

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

Parameter types for rootattribute and targetattribute #28

Closed ulemanstreaming closed 9 years ago

ulemanstreaming commented 9 years ago

It seems the attribute types for rootattribute (TupleToJSON) and probably targetattribute (JSONToTuple) are specified wrong. At least in TupleToJSON (haven't tried the other yet), I am unable to specify a tuple-type attribute containing the structure to be converted; it's looking for an rstring ("CDISP0048E The rootAttribute operator parameter requires values of the rstring type, but values of the tuple<int32 load,int32 disp,int32 temp,int32 hum,int32 vib,int32 x1,int32 x2,int32 x3> type are specified.")

By default, it looks at the whole tuple. If you specify an attribute, I would think that the attribute should be a tuple or a collection. Requiring an rstring does not make sense to me.

rohitsw commented 9 years ago

Its asking for the name of the attribute specified as an rstring. The attribute type itself does not need to be an rstring.

ulemanstreaming commented 9 years ago

I think I misunderstood. Apparently, I have to specify the NAME of an attribute as an rstring. So that means param rootattribute : "values" ; and not param rootattribute : values ; (where values is an attribute of the input schema that happens to be a tuple.) In a standard-toolkit operator, I would expect the latter formulation.

So, apparently the parameter mode is expression instead of attribute. Why?

ulemanstreaming commented 9 years ago

Sorry Rohit, I had stepped away while editing a comment; didn't notice your response. In any case I came to the right realization. Now I just wonder why it is that way.

rohitsw commented 9 years ago

SPL Java operators don't currently support specifying of attribute types.

ulemanstreaming commented 9 years ago

Ah yes. I was afraid that might be the case. I was trying to find documentation to that effect but chose the lazy way and asked you instead. Thanks.