Striim 3.9.7 documentation

JSON sources with custom output types

The basic programming pattern for sources using adapters with the JSONParser is:

type, stream, source

First define the type for the output stream, then the stream, then the source. For example:

CREATE TYPE ScanResultType (
  timestamp1 String,
  rssi String
);
CREATE STREAM ScanResultStream OF ScanResultType;

CREATE SOURCE JSONSource USING FileReader (
  directory: 'Samples',
  WildCard: 'sample.json',
  positionByEOF: false
)
PARSE USING JSONParser (
  eventType: 'ScanResultType',
  fieldName: 'scanresult'
)
OUTPUT TO ScanResultStream;

See JSONParser for a more detailed discussion.