Monday, April 27, 2015

How to use tFilterColumns component in Talend


tFilterColumns component is used for removing the unwanted columns from the job flow.We can do the same process from tMap but tFiltercolumns make is more explicit that we are filtering the columns from one flow to another.

This is our Shippers Input File .
Shipper_ID,Shipper_Name,Phone
1,Shiny Shipping,4133694044
2,Rose Marry Ship Pvt,5703453631
3,Nick Ltd,3038141672
4,Michle Ltd,7274882222

So firstly create a new job from Job Designs > Create Job.
Drag the schema of Shippers.csv from Metadata > File Delimited > Shippers and drop it to the design work space and select tfileInputDelimited option from pop window.This Shippers.csv file is been taken as an input file
Or you can simply drag this component from the palette and double click on it to open the component properties and click [...] next to the File Name field to specify the path where you have created your Shippers.csv file.
Then drag and drop the following components from the palette into the design workspace:-tFilterColumns,tLogRow.
Connect each component by right clicking and select Row > Main.


Then double click on tFilterColumns to open its component properties click on Edit Schema this window will open now there are three columns in Shippers Input you want two columns from input to be filtered so simply drag it from Shippers (Input-Main) to tFilterColumns_1(Output).Now we want only two columns Shipper_ID and Shipper_Name instead of three columns.



In the Basic settings of tLogRow components, select Table (print values in cells of a table) to show result in table format.
Atlast Run the Job.


Here you can see that we have three columns in our Input File and at result we have two columns that we want to filter.

No comments:

Post a Comment