-
Double-click the tMap component to open
the Map Editor.
Drop the idState column from the main input table to
the idState column of the lookup table to create a
join.
Click the tMap settings button and set
Join Model to Inner Join.
-
Click the Property Settings button at the
top of the input area to open the Property
Settings dialog box, and clear the Die
on error check box in order to handle the execution errors.
The ErrorReject table is automatically
created.
-
Select the id, idState,
RegTime and RegisterTime in
the input table and drag them to the ErrorReject table.
-
Click the [+] button at the top right of
the editor to add an output table. In the dialog box that opens, select
New output. In the field next to it,
type in the name of the table, out1. Click OK.
-
Drag the following columns from the input tables to the
out1 table: id,
CustomerName, idState, and
LabelState.
Add two columns, RegTime and
RegisterTime, to the end of the
out1 table and set their date formats:
"dd/MM/yyyy HH:mm"
and "yyyy-MM-dd
HH:mm:ss.SSS"
respectively.
-
Click in the Expression field for the
RegTime column, and press Ctrl+Space to display the auto-completion list. Find and
double-click
TalendDate.parseDate
. Change the pattern to
("dd/MM/yyyy HH:mm",row1.RegTime)
.
-
Do the same thing for the RegisterTime column, but
change the pattern to
("yyyy-MM-dd
HH:mm:ss.SSS",row1.RegisterTime)
.
-
Click the [+] button at the top of the
output area to add an output table. In the dialog box that opens, select
Create join table from, choose
Out1, and name it rejectInner.
Click OK.
-
Click the tMap settings button and set
Catch lookup inner join reject to
true in order to handle rejects.
-
Drag the id, CustomerName, and
idState columns from the input tables to the
corresponding columns of the rejectInner table.
Click in the Expression field for the
LabelState column, and type in
"UNKNOWN"
.
-
Click in the Expression field for the
RegTime column, press Ctrl+Space, and select
TalendDate.parseDate
. Change the
pattern to ("dd/MM/yyyy HH:mm",row1.RegTime)
.
-
Click in the Expression field for the
RegisterTime column, press Ctrl+Space, and select
TalendDate.parseDate
, but change
the pattern to ("yyyy-MM-dd
HH:mm:ss.SSS",row1.RegisterTime)
.
If the data from row1 has a wrong pattern, it will
be returned by the ErrorReject flow.
Click OK to validate the changes and
close the editor.
-
Double-click the first tLogRow component
to display its Component view.
Click Sync columns to retrieve the
schema structure from the mapper if needed.
In the Mode area, select Table.
Do the same thing with the second tLogRow.