Mapping join

Supported in: Batch

Replaces values from the target columns in the source dataset with values in the mapping dataset.

Transform categories: Join

Declared arguments

  • Input dataset - Source dataset containing columns to be mapped.
    Table
  • Key column for mapping values - Key column for mapping values.
    Column<T1>
  • Mapping dataset - Dataset containing values to use for mapping.
    Table
  • Target columns - List of columns from left that will have values replaced.
    List<Column<T1>>
  • Values to use for mapping - Values to use for mapping.
    Column<T2>
  • optional Assume unique mappings - If true, a distinct operation will be applied to the key column of the mapping table. If false, and the mapping table contains duplicate keys, the resulting dataset will contain duplicate rows based on each mapping. By default, this operation is applied. Note: setting this to false may result in better performance.
    Literal<Boolean>
  • optional Default value - If empty, values from the target columns will remain unchanged if no mapping is found in the mapping table. By default, this is empty.
    Expression<T2>

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

Examples

Example 1: Base case

Argument values:

  • Input dataset: ri.foundry.main.dataset.input
  • Key column for mapping values: flight_code
  • Mapping dataset: ri.foundry.main.dataset.mapping
  • Target columns: [flight_no, next_flight]
  • Values to use for mapping: flight_number
  • Assume unique mappings: null
  • Default value: unknown

Inputs: ri.foundry.main.dataset.input

flight_nonext_flightdeparture_time
5331122022-01-20T10:45:00Z
9345332022-01-20T11:20:00Z
2229342022-01-20T11:20:00Z

ri.foundry.main.dataset.mapping

flight_codeflight_numberairline
112XB-123foundry airlines
533MT-444foundry airlines
934KK-123new air

Output:

flight_nonext_flightdeparture_time
MT-444XB-1232022-01-20T10:45:00Z
KK-123MT-4442022-01-20T11:20:00Z
unknownKK-1232022-01-20T11:20:00Z