Versions Compared

Key

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

...

Code Block
languagepql
tupleToKeyValue = TUPLETOKEYVALUE({type='KEYVALUEOBJECT'}, receiverTuple)

Select

The select operator can be used for key value objects in the same way as for tuples.

Code Block
languagepql
selectJSON = SELECT({predicate='track.artist.name = "Evanescence"'}, receiverJSON)
selectJSONList = SELECT({predicate='timestamp.unixtimestamp[0] = 1162304033'}, receiverJSON)

Project

For the key - value projection the "paths" attribute has to be used. The "attributes" attribute only works for relational tuples.

Code Block
languagepql
 projectJSON = PROJECT({paths = [['timestamp.unixtimestamp', 'List(Integer)'],['timestamp.iso', 'String']]}, receiverJSON)

Rename

 To rename the attributes of key value objects the "pairs" parameter has to be set to true and the old and new attributenames have to be given in the "aliases" parameter.

Code Block
languagepql
renamed = RENAME({aliases = ['Zeit', 'ZeitNew', 'Band', 'BandNew'], pairs = 'true'}, mapped)

...