The procedure below shows how to configure mappings and an inner join to output movies information with valid director IDs.
Double-click the tMap component to open the map
The map editor shows three tables, named row1, row2 and Valid_movies in this example, corresponding respectively to the movies file schema, the directors file schema, and the schema of the output for valid movies information, and columns in the row1 table are already mapped to the columns in the Valid_movies table.
Select the directorID column
in the row1 table, and drop it onto the
directorID column in the
row2 table to create a join
between the two input data sets based on the director
Click the tMap
settings button, then click Value field for Join Model, and then click
the [...] button that
appears to open the Options
dialog box. In the dialog box, select Inner Join and click OK to define the join as an
With this setting, only the movie records with the director IDs matching with those in the reference file will be passed to the output.
- In the Schema editor at the bottom of the map editor, select directorID column of the output schema, Valid_movies in this example, and click the [X] button to remove it.
Click the [+]
button beneath the output table to add a new column, name it
directedBy, set its length to
20, and move it up so that
it's between the title and
Select the directorName
column in the row2 table, and drop it
to the Expression field
corresponding to the directedBy
column in the output table.
A new mapping is created between lookup table and the output table.
Click OK to
validate the mappings and close the map editor, and click
Yes when asked
whether to propagate the changes.
The mapping configurations are saved and the output schema is synchronized to the output component tLogRow.
Press F6 or
click the Run button on
the Run view to execute
Only movie records with valid director information are displayed on the Run console.