Versions Compared

Key

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

...

The following new or modificated operators are provided in keyvalue feature.

KeyValueToTuple

Transforms key-value object to tuples. All data fields which are not defined in schema will be lost.

Code Block
languagepql
#DEFINE SCHEMA [['timestamp.unixtimestamp', 'List(Integer)'],['timestamp.iso', 'String'],['track.name', 'String']]
tuple = KEYVALUETOTUPLE({schema=${SCHEMA}, KEEPINPUT = 'false', TYPE = 'type'}, receiverJSON)

TupleToKeyValue

Transforms tuples to key-value objects based on tuples schema.

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
renamed = RENAME({aliases = ['Zeit', 'ZeitNew', 'Band', 'BandNew'], pairs = 'true'}, mapped)

Map

For the key value MAP operator the "kvexpressions" attribute has to be used. The "expressions" attribute only works for relational tuples.

...