Number of input and output field
| Number of input field |
: |
One |
| Number of output field |
: |
One |
This transformation function is used to process dynamic reference–based if–then–else statements. It is applicable when the reference data can fit into the memory of each worker. If the reference data is too large, it is recommended to use a reduce-side join assembly instead.
The parameters of this transformation function are:
- File Reference
The name of the reference file.
- Field Splitter
The delimiter used to split each row of the reference file into parts (reference field and value field). The default value is ;.
- Index of. Ref Field
The index of the field in the reference file that will be matched against the input value. The default is 0. For example, a value of 1 means the second field is used as the lookup key.
- Index of Output Field
The index of the field whose value will be returned.
- Delimiter of ref. Field data
The delimiter used to split the reference field value. A single reference value may be split into multiple parts that are associated with a return value.
For example, the content of the reference file data.txt:
A|1;2;3;4
B|5;6;7
C|8;9;10
If the parameter Values:
- File Reference : data.txt
- Field Splitter : |
- Index of. Ref Field : 1
- Index of Output Field : 0
- Delimiter of ref. Field data : ;
Then the transformation is equivalent to the following statements:
if input in (1,2,3,4) then
return A
else if input in (5,6,7) then
return B
else if input in (8,9,10) then
return C
else
return null