Map values

Supported in: Batch, Streaming

Map a set of values in a column to new values.

Expression categories: Data preparation

Declared arguments

  • Default - This value is chosen if values are not mapped by the value map.
    Expression<T2>
  • Input - Values to be mapped.
    Expression<T1>
  • Value map - Values to be mapped.
    Expression<Map<T1, T2>>

Type variable bounds: T1 accepts ComparableType**T2 accepts AnyType

Output type: T2

Examples

Example 1: Base case

Argument values:

  • Default: null
  • Input: country
  • Value map: {
     Denmark -> DNK,
     United Kingdom -> UK,
    }
countryOutput
United KingdomUK
DenmarkDNK
United States of Americanull

Example 2: Base case

Argument values:

  • Default: country
  • Input: country
  • Value map: {
     Denmark -> DNK,
     United Kingdom -> null,
    }
countryOutput
United Kingdomnull
nullnull