You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

The JSON protocol handler parses JSON documents.

Options

  • json.write.metadata: Dumps the metadata
  • json.write.starttimestamp: Adds the starttimestamp to the key value object under the given key
  • json.write.endtimestamp: Adds the endtimestamp to the key value object under the given key

Example

PQL

JSONProtocolHandler
json = ACCESS({
    source='json', 
    wrapper='GenericPull',
    transport='File',
    protocol='JSON',
    dataHandler='KeyValueObject',   
    options=[['filename','scrobbles-2006-10.json']]
})
JSONProtocolHandler
SENDERjson = SENDER({ 
    transport='File', 
    wrapper='GenericPush', 
    protocol='JSON', 
    dataHandler='KeyValueObject', 
    SINK="SENDERjson", 
    options=[ 
        ['filename','${WORKSPACEPROJECT}\testdata\tupletokeyvalue\output.json'], 
        ['json.write.metadata','true'],
        ['json.write.starttimestamp','metadata.starttimestamp'], 
        ['json.write.endtimestamp','metadata.endtimestamp'] 
    ]}, tupletokeyvalue0)

 

CQL

JSON Protocol Handler
CREATE STREAM line (symbol String, points Double)   
    WRAPPER 'GenericPush'
    PROTOCOL 'JSON'
    TRANSPORT 'File'
    DATAHANDLER 'Tuple'
  • No labels