Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This operator can be used to translate a an object (e.g.  key-value/json object) to a tuple. In KeyValue case Names are JSON-Path Exceptions. If names contains special chars like ".", "*", etc. the chars will be replaced by "_".  To define own names you ['Path','Name','Type'] in the schema.

Parameter

  • schema: The list of requested attributes (keys) and their data type.
  • type: The type of the output tuplekeepInput: If set to true, the key-value is stored in the additional content container of the output tuple.
  • dateFormat: Can be used to format the timestamp. To create a timestamp an attribute of data type STARTTIMESTAMP or ENDTIMESTAMP has to be added to schema.

Example 1

Code Block
languagepql
titleExample
out = KEYVALUETOTUPLETOTUPLE({
          schema=[['Name', 'Double']],
          type='Measurement',
          keepinput='false' 
        },
        in
      )

Example 2

Assume that a data source in sends key-value-pairs about persons in the following (JSON-)format: 

...

Code Block
languagepql
titleExample
out = KEYVALUETOTUPLETOTUPLE({
          schema=[['person.name', 'String'], ['timestamp', 'STARTTIMESTAMP']],
          type='Measurement',
          keepinput='false' 
        },
        in
      )