IBMStreams / streamsx.json

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

Add support for blobs in JsonToTuple and TupleToJson #122

Closed natashadsilva closed 3 years ago

natashadsilva commented 4 years ago

In the tuple to JSON operator, we could convert a blob to a base64 encoded string so that it could be included in the output, and vice versa for converting json to tuples.

markheger commented 3 years ago

What about the alternative using spl.utility::Format and spl.utility::Parse for the Blob to String conversion and String to Blob conversion?

Another binary alternative is AVRO, the streamsx.avro toolkit supports conversion from JSON to AVRO and vice versa.

Is there any specific reason, why the JsonToTuple and TupleToJson shall be extended to support blob format?

@natashadsilva Or is this request for supporting binary attributes as value in a JSON structure?

rnostream commented 3 years ago

Base64 encoded string may contain any content. I think it is special agreement between sender and receiver (as JSON is seen to be used as general format) what a base64 string contains. Blob is very special for Streams and if someone want's to send or store a Streams blob in a JSON as base64 encoded string this has to be done in surrounding code. My opinion ... JSON contains a string (JSON format element) and how this string should be interpreted has to be controlled by different layer.