Table of Contents

Search

  1. Preface
  2. The Transformation Language
  3. Constants
  4. Operators
  5. Variables
  6. Dates
  7. Functions

Transformation Language Reference

Transformation Language Reference

MAP

MAP

Generates a map with elements based on the specified key-value pair.

Syntax

MAP(map_key1 as any, map_value1 as any [, map_key2, map_value2]...)
The following table describes the arguments for this command:
Argument
Required/Optional
Description
map_key1
Required
Any primitive data type. An element that you want to add as a key of the map data. You can enter any valid transformation expression.
map_value1
Required
Any primitive or complex data type. An element that you want to add as a value for the key of the map data. You can enter any valid transformation expression.
If you use the MAP function in an output expression for a map port, the data type of the function arguments must match the data type of the map elements specified in the type configuration for the map port. The map_key cannot be null.

Return Value

Map.
The data type of arguments determines the data type of the map elements. For example, if you pass integer arguments as key and struct arguments as value, the function generates map data with a key-value pair of integer and struct types.

Examples

The following expression generates a map of integer and string elements.
MAP(emp_id, emp_name)
emp_id
emp_name
RETURN VALUE
45781
‘Laura’
[45781 -> ‘Lauren’]
78345
‘Derrick’
[78345 -> ‘Derrick’]
87289
‘Kevin’
[87289 -> ‘Kevin’]
30912
[30912 -> NULL]

0 COMMENTS

We’d like to hear from you!