IBMStreams / streamsx.json

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

Operators need to handle mapping to SPL reserved keywords #72

Closed cancilla closed 7 years ago

cancilla commented 7 years ago

If a JSON document contains keys that are reserved words in SPL, there is currently no way to map those key/value pairs into an SPL attribute.

For example, suppose I have the following JSON:

    {"type" : "a", "class" : "b"}

Since "type" and "class" are reserved words in SPL, you cannot have a schema that contains attributes with those names (i.e. tuple<rstring type, rstring class> is not valid).

The operators need to either handle the mapping of reserved key names (i.e. automatically map key "type" to something such as SPL attribute "type_") or allow the user to provide a custom mapping.

markheger commented 7 years ago

Operators should handle this similar to the XML parse operator with the ignorePrefix parameter

schubon commented 7 years ago

Closing after merge of Mark's changes.