...
Mappings for the values are usually stored in a key-value dataset. The Value Mapper transformation provides a simple method for manipulating input data, both a field and its values, using a mapping.
Use Case
One use is to replace language codes in the input record field with an appropriate language description:
...
This will replace the source column language_code with the target column language_desc, replacing values found in the source field using the mappings "DE" to "German", "ES" to "Spanish", and so on.
Configuration
Property | Macro Enabled? | Description |
---|---|---|
Mapping | No | Required. A comma-separated list that defines the mapping of a source field to a target field and the mapping table name for looking up values. Contains three properties separated by a colon (":") as the source field, the mapping table name, and the target field:
Note: Source field supports only STRING types. |
Defaults | No | Required. A comma-separated list that contains key-value pairs of a source field and its default value for cases where the source field value is either null or empty or if the mapping key-value is not present. If a default value has not been provided, the source field value will be mapped to the target field. Only STRING NULLABLE type values are accepted. Example: <source field>:<defaultValue> |
Output Schema | No | Required. The output schema for the data. |
Example
As an example, take employee details as input data through a stream and then apply the Value Mapper transformation on the designation field in the input data.
...